-
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.
- Loading branch information
Showing
4 changed files
with
39 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,9 @@ __pycache__/ | |
# C extensions | ||
*.so | ||
|
||
# IDE config | ||
.idea/ | ||
|
||
# Distribution / packaging | ||
.Python | ||
env/ | ||
|
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,2 @@ | ||
# -*- coding:utf8 -*- | ||
__author__ = 'ltyao' |
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 @@ | ||
# -*- coding:utf8 -*- | ||
__author__ = 'ltyao' | ||
import os | ||
from os.path import join, getsize | ||
|
||
|
||
def cmp_size(left_dir, right_dir): | ||
for root, dirs, files in os.walk(left_dir): | ||
for file_name in files: | ||
left = getsize(join(root, file_name)) | ||
right = getsize(join(root.replace(left_dir, right_dir), file_name)) | ||
if cmp(left, right) != 0: | ||
print root, file_name, left - right | ||
|
||
|
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,19 @@ | ||
__author__ = 'ltyao' | ||
|
||
import unittest | ||
from size_diff import cmp_size | ||
|
||
|
||
class SizeTestCase(unittest.TestCase): | ||
def setUp(self): | ||
self.left_dir = "D:\Users\ltyao\PycharmProjects\untitled5\NET_1367635\ws.mobilesecure.payment.soa2\payment" | ||
self.right_dir = "D:\Users\ltyao\PycharmProjects\untitled5\NET_1368884\ws.mobilesecure.payment.soa2\payment" | ||
|
||
def test_echo(self): | ||
cmp_size(self.left_dir, self.right_dir) | ||
print("--------------------") | ||
cmp_size(self.right_dir, self.left_dir) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |