generated from ApeWorX/project-template
-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor!: remove global config and flatten [APE-1455] (#14)
Co-authored-by: Juliya Smith <[email protected]>
- Loading branch information
Showing
6 changed files
with
37 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,51 @@ | ||
from ape_addressbook import addressbook | ||
|
||
|
||
def test_config(book, project_alias_unchecksummed, project_alias_no_quotes, project_address): | ||
def test_config(project_alias_unchecksummed, project_alias_no_quotes, project_address): | ||
""" | ||
This test shows that we are able to read values from a | ||
project's config as well as handle checksumming them if needbe. | ||
""" | ||
|
||
actual = book.config.entries | ||
actual = addressbook.config | ||
assert len(actual) == 2 | ||
assert actual[project_alias_unchecksummed] == project_address | ||
assert actual[project_alias_no_quotes] == project_address | ||
|
||
|
||
def test_registry( | ||
book, | ||
global_alias, | ||
project_alias_unchecksummed, | ||
project_alias_no_quotes, | ||
project_address, | ||
global_address, | ||
): | ||
actual = book.registry | ||
assert len(actual) == 3 | ||
assert actual[global_alias] == global_address | ||
actual = addressbook.registry | ||
assert len(actual) == 2 | ||
assert actual[project_alias_unchecksummed] == project_address | ||
assert actual[project_alias_no_quotes] == project_address | ||
|
||
|
||
def test_aliases(book, global_alias, project_alias_unchecksummed, project_alias_no_quotes): | ||
def test_aliases(project_alias_unchecksummed, project_alias_no_quotes): | ||
""" | ||
The aliases includes both project and global addresses. | ||
""" | ||
|
||
assert list(addressbook.aliases) == [ | ||
global_alias, | ||
project_alias_unchecksummed, | ||
project_alias_no_quotes, | ||
] | ||
actual = list(addressbook.aliases) | ||
expected = [project_alias_no_quotes, project_alias_unchecksummed] | ||
assert actual == expected | ||
|
||
|
||
def test_contains( | ||
book, | ||
global_alias, | ||
global_address, | ||
project_alias_unchecksummed, | ||
project_address, | ||
project_alias_no_quotes, | ||
): | ||
assert global_alias in book | ||
assert project_alias_unchecksummed in book | ||
assert project_alias_no_quotes in book | ||
assert project_alias_unchecksummed in addressbook | ||
assert project_alias_no_quotes in addressbook | ||
|
||
|
||
def test_get_item( | ||
book, | ||
global_alias, | ||
global_address, | ||
project_alias_unchecksummed, | ||
project_address, | ||
project_alias_no_quotes, | ||
): | ||
assert book[global_alias] == global_address | ||
assert book[project_alias_unchecksummed] == project_address | ||
assert book[project_alias_no_quotes] == project_address | ||
assert addressbook[project_alias_unchecksummed] == project_address | ||
assert addressbook[project_alias_no_quotes] == project_address |