Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: TT-384 changed test name with correct formatting
  • Loading branch information
Jobzi authored Nov 9, 2021
commit f9532ea8d5d4356ebd360f532dce116444fd15d9
4 changes: 2 additions & 2 deletions tests/commons/data_access_layer/file_stream_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

fs = FileStream("storageaccounteystr82c5","tt-common-files")

def test_get_file_stream_return_file_when_enter_file_name():
def test__get_file_stream__return_file_content__when_enter_file_name():
result = fs.get_file_stream("activity_test.json")

assert len(json.load(result)) == 15

def test_get_file_stream_return_None_when_not_enter_file_name_or_incorrect_name():
def test__get_file_stream__return_None__when_not_enter_file_name_or_incorrect_name():
result = fs.get_file_stream("")

assert result == None
14 changes: 13 additions & 1 deletion tests/time_tracker_api/activities/activities_model_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def test_create_activity_should_add_active_status(
data=expect_argument, event_context=ANY
)

def test_find_all_from_blob_storage(
def test__find_all_from_blob_storage__return_list__when_send_event_context_and_correct_file_name(
event_context: EventContext,
activity_repository: ActivityCosmosDBRepository,
):
Expand All @@ -76,3 +76,15 @@ def test_find_all_from_blob_storage(
file_name="activity_test.json"
)
assert len(result) == 15

def test__find_all_from_blob_storage__return_empty_list__when_send_event_context_and_incorrect_file_name(
event_context: EventContext,
activity_repository: ActivityCosmosDBRepository,
):
activity_repository.container = Mock()

result = activity_repository.find_all_from_blob_storage(
event_context=event_context,
file_name="incorrect.json"
)
assert result == []
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

fake_activity = ({"id": fake.random_int(1, 9999)}).update(valid_activity_data)

def test_get_all_activities_return_list_activities_when_send_get_request(
def test__get_all_activities__return_response__when_send_activities_get_request(
client: FlaskClient, valid_header: dict
):
response = client.get(
Expand Down