Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@VakarisZ
Copy link
Contributor

What does this PR do?

Fixes #1966
Renames repository files to snake case

Add any further explanations here.

PR Checklist

  • Have you added an explanation of what your changes do and why you'd like to include them?
  • Is the TravisCI build passing?
  • Was the CHANGELOG.md updated to reflect the changes?
  • Was the documentation framework updated to reflect the changes?
  • Have you checked that you haven't introduced any duplicate code?

Testing Checklist

  • Added relevant unit tests?
  • Have you successfully tested your changes locally? Elaborate:

    Tested by running unit tests

  • If applicable, add screenshots or log transcripts of the feature working

Explain Changes

Are the commit messages enough? If not, elaborate.

@VakarisZ VakarisZ marked this pull request as ready for review May 31, 2022 10:13
@codecov
Copy link

codecov bot commented May 31, 2022

Codecov Report

Merging #1972 (027c53a) into develop (1bfffb0) will increase coverage by 0.06%.
The diff coverage is 80.00%.

@@             Coverage Diff             @@
##           develop    #1972      +/-   ##
===========================================
+ Coverage    56.44%   56.50%   +0.06%     
===========================================
  Files          461      462       +1     
  Lines        13006    12986      -20     
===========================================
- Hits          7341     7338       -3     
+ Misses        5665     5648      -17     
Impacted Files Coverage Δ
.../monkey_island/cc/repository/i_agent_repository.py 0.00% <ø> (ø)
...monkey_island/cc/repository/i_attack_repository.py 0.00% <ø> (ø)
...monkey_island/cc/repository/i_config_repository.py 0.00% <ø> (ø)
...ey/monkey_island/cc/repository/i_log_repository.py 0.00% <ø> (ø)
...onkey_island/cc/repository/i_machine_repository.py 0.00% <ø> (ø)
...y_island/cc/repository/i_network_map_repository.py 0.00% <ø> (ø)
...monkey_island/cc/repository/i_report_repository.py 0.00% <ø> (ø)
...ey_island/cc/repository/i_simulation_repository.py 0.00% <ø> (ø)
...d/cc/repository/i_stolen_credentials_repository.py 0.00% <ø> (ø)
...key_island/cc/repository/i_telemetry_repository.py 0.00% <ø> (ø)
... and 11 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b3710e4...027c53a. Read the comment docs.



class DirectoryFileStorageService(IFileStorageService):
class FilesystemStorage(IFileRepository):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
class FilesystemStorage(IFileRepository):
class FileSystemStorage(IFileRepository):

Copy link
Collaborator

@mssalvatore mssalvatore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double check the naming of everything in the tests. There are classes, fixtures, and local variables named file_storage_service or similar.



class DirectoryFileStorageService(IFileStorageService):
class FileSystemStorage(IFileRepository):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Repositories should be named after their interfaces.

Suggested change
class FileSystemStorage(IFileRepository):
class FileSystemFileRepository(IFileRepository):

or

Suggested change
class FileSystemStorage(IFileRepository):
class LocalStorageFileRepository(IFileRepository):

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? Is this a general guideline that if we have an interface IAnimal, then concrete class will be called CatAnimal(IAnimal)?



class MockFileStorageService(IFileStorageService):
class MockFileStorageService(IFileRepository):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
class MockFileStorageService(IFileRepository):
class MockFileRepository(IFileRepository):

def flask_client(build_flask_client, file_storage_service):
container = StubDIContainer()
container.register_instance(IFileStorageService, file_storage_service)
container.register_instance(IFileRepository, file_storage_service)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
container.register_instance(IFileRepository, file_storage_service)
container.register_instance(IFileRepository, file_repository)

@VakarisZ VakarisZ requested a review from mssalvatore May 31, 2022 13:13
@mssalvatore mssalvatore merged commit 6cea0c9 into develop May 31, 2022
@mssalvatore mssalvatore deleted the 1966-i-file-storage branch May 31, 2022 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IFileStorageService to Repository

4 participants