-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
latentvector
committed
May 17, 2024
1 parent
d94ae75
commit fe8c1e6
Showing
3 changed files
with
122 additions
and
221 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
import os | ||
import commune as c | ||
class Test(c.Module): | ||
def test_file(self, k='test_a', v=1): | ||
c.put(k,v) | ||
assert self.exists(k), f'file does not exist ({k})' | ||
self.encrypt_file(k) | ||
c.print(self.get_text(k)) | ||
self.decrypt_file(k) | ||
new_v = self.get(k) | ||
assert new_v == v, f'new_v {new_v} != v {v}' | ||
self.rm(k) | ||
assert not self.exists(k) | ||
assert not os.path.exists(self.resolve_path(k)) | ||
return {'success': True, 'msg': 'test_file passed'} | ||
|
||
def test_folder_module_detector(self,positives = ['module', 'vali', 'client']): | ||
for p in positives: | ||
assert self.is_folder_module(p) == True, f'{p} is a folder module' | ||
return {'success': True, 'msg': 'All folder modules detected', 'positives': positives} | ||
|
Oops, something went wrong.