-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Leaving the alpha version
- Loading branch information
Showing
6 changed files
with
80 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "frozenclass" | ||
version = "0.0.7a1" | ||
version = "0.0.8" | ||
description = "Python module for convenient storage of classes in files." | ||
authors = ["GigantPro <[email protected]>"] | ||
license = "The GPLv3 License (GPLv3)" | ||
|
@@ -24,7 +24,7 @@ build = "scripts.build:build" | |
public = "scripts.public:public" | ||
linting = "scripts.pylint:start_linting" | ||
testing = "scripts.testing:start_testing" | ||
autoclean = "scripts.autoclean:autoclean" | ||
clean = "scripts.autoclean:autoclean" | ||
|
||
[tool.pylint] | ||
max-line-length = 120 | ||
|
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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
from random import choice | ||
from string import ascii_letters | ||
import pytest | ||
|
||
from frozenclass import DataController | ||
|
||
|
||
class PublicClassA: | ||
third = '123' | ||
|
||
|
||
class PublicClassB: | ||
first = 123 | ||
second = PublicClassA() | ||
|
||
|
||
def test_save_load_deep_with_globals_bases(): | ||
ts_object = PublicClassB() | ||
|
||
controller = DataController("test_saves") | ||
|
||
save_name = controller.deep_freeze(ts_object) | ||
|
||
new_class = controller.load_save(save_name) | ||
|
||
assert new_class.first == 123 and new_class.second.third == '123' | ||
|
||
|
||
def test_save_load_deep_with_locals_bases(): | ||
class LocalClassA: | ||
third = '123' | ||
|
||
|
||
class LocalClassB: | ||
first = 123 | ||
second = LocalClassA() | ||
|
||
|
||
ts_object = LocalClassB() | ||
|
||
controller = DataController("test_saves") | ||
|
||
save_name = controller.deep_freeze(ts_object) | ||
|
||
new_class = controller.load_save(save_name) | ||
|
||
assert new_class.first == 123 and new_class.second.third == '123' |