File tree Expand file tree Collapse file tree 3 files changed +16
-4
lines changed
commons/data_access_layer
time_tracker_api/activities Expand file tree Collapse file tree 3 files changed +16
-4
lines changed Original file line number Diff line number Diff line change 44
55fs = FileStream ("storageaccounteystr82c5" ,"tt-common-files" )
66
7- def test_get_file_stream_return_file_when_enter_file_name ():
7+ def test__get_file_stream__return_file_content__when_enter_file_name ():
88 result = fs .get_file_stream ("activity_test.json" )
99
1010 assert len (json .load (result )) == 15
1111
12- def test_get_file_stream_return_None_when_not_enter_file_name_or_incorrect_name ():
12+ def test__get_file_stream__return_None__when_not_enter_file_name_or_incorrect_name ():
1313 result = fs .get_file_stream ("" )
1414
1515 assert result == None
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ def test_create_activity_should_add_active_status(
6565 data = expect_argument , event_context = ANY
6666 )
6767
68- def test_find_all_from_blob_storage (
68+ def test__find_all_from_blob_storage__return_list__when_send_event_context_and_correct_file_name (
6969 event_context : EventContext ,
7070 activity_repository : ActivityCosmosDBRepository ,
7171):
@@ -76,3 +76,15 @@ def test_find_all_from_blob_storage(
7676 file_name = "activity_test.json"
7777 )
7878 assert len (result ) == 15
79+
80+ def test__find_all_from_blob_storage__return_empty_list__when_send_event_context_and_incorrect_file_name (
81+ event_context : EventContext ,
82+ activity_repository : ActivityCosmosDBRepository ,
83+ ):
84+ activity_repository .container = Mock ()
85+
86+ result = activity_repository .find_all_from_blob_storage (
87+ event_context = event_context ,
88+ file_name = "incorrect.json"
89+ )
90+ assert result == []
Original file line number Diff line number Diff line change 1919
2020fake_activity = ({"id" : fake .random_int (1 , 9999 )}).update (valid_activity_data )
2121
22- def test_get_all_activities_return_list_activities_when_send_get_request (
22+ def test__get_all_activities__return_response__when_send_activities_get_request (
2323 client : FlaskClient , valid_header : dict
2424):
2525 response = client .get (
You can’t perform that action at this time.
0 commit comments