-
Notifications
You must be signed in to change notification settings - Fork 176
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
Showing
8 changed files
with
77 additions
and
1 deletion.
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
Empty file.
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,40 @@ | ||
import unittest | ||
from hubmirror import Mirror | ||
from hubmirror import Hub | ||
from hubmirror import HubMirror | ||
import shutil | ||
|
||
class TestMirror(unittest.TestCase): | ||
|
||
def test_download(self): | ||
self.github2gitee = Hub( | ||
"github/hub-mirror-action", | ||
"gitee/hub-mirror-action", | ||
"dd68f7a02fb01594b4d5de363fe0bf67", | ||
"org", | ||
"ssh" | ||
) | ||
self.gitee2github = Hub( | ||
"gitee/hub-mirror-action", | ||
"github/hub-mirror-action", | ||
"9d0a194733b7bbc6d8c042736b1250f5e6009ab1", | ||
"org", | ||
"ssh" | ||
) | ||
self.m1 = Mirror(self.gitee2github, "normal") | ||
# Download a repo from gitee | ||
self.m1.download() | ||
# Create a repo in github | ||
# self.m1.create() | ||
|
||
# self.m2 = Mirror(self.github2gitee, "normal") | ||
# # Download a repo from github | ||
# self.m2.download() | ||
# # Create a repo in gitee | ||
# self.m2.create() | ||
# self.m2.push(force=True) | ||
|
||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |
Empty file.
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,15 @@ | ||
import unittest | ||
from utils import str2map | ||
|
||
|
||
class TestUtils(unittest.TestCase): | ||
|
||
def test_str2map(self): | ||
self.assertEqual(str2map("a=>b, c=>d"), {'a': 'b', 'c': 'd'}) | ||
self.assertEqual(str2map("a=>b,c=>d"), {'a': 'b', 'c': 'd'}) | ||
# No transitivity | ||
self.assertEqual(str2map("cc=>c,c=>d"), {'cc': 'c', 'c': 'd'}) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |
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