url_in and url_is renamed to url_dir and url_file
Change-Id: Ida034859d06cc649d6658ef14ebfecc80586b439
diff --git a/rsync_url.py b/rsync_url.py
index f69e93a..619dbbb 100644
--- a/rsync_url.py
+++ b/rsync_url.py
@@ -193,7 +193,7 @@
result += '/'
return result
- def url_in(self, *path):
+ def url_dir(self, *path):
return self.a_dir(self.url, *path)
def a_file(self, *path):
@@ -203,5 +203,5 @@
result = result[:-1]
return result
- def url_is(self, *path):
+ def url_file(self, *path):
return self.a_file(self.url, *path)
diff --git a/test_rsync_url.py b/test_rsync_url.py
index 0eecbf4..e1a3261 100644
--- a/test_rsync_url.py
+++ b/test_rsync_url.py
@@ -79,13 +79,13 @@
logger.info('par = "{}", er = "{}"'.format(par, er))
self.assertEqual(url.a_dir(par), er)
- def url_in(self, remote, expected_result):
+ def url_dir(self, remote, expected_result):
logger.info('For "{}" should be {}'.format(remote, expected_result))
url = rsync_url.RsyncUrl(remote)
self.log_locals(url)
for par, er in expected_result.items():
logger.info('par = "{}", er = "{}"'.format(par, er))
- self.assertEqual(url.url_in(par), er)
+ self.assertEqual(url.url_dir(par), er)
def a_file(self, remote, expected_result):
logger.info('For "{}" should be {}'.format(remote, expected_result))
@@ -95,13 +95,13 @@
logger.info('par = "{}", er = "{}"'.format(par, er))
self.assertEqual(url.a_file(par), er)
- def url_is(self, remote, expected_result):
+ def url_file(self, remote, expected_result):
logger.info('For "{}" should be {}'.format(remote, expected_result))
url = rsync_url.RsyncUrl(remote)
self.log_locals(url)
for par, er in expected_result.items():
logger.info('par = "{}", er = "{}"'.format(par, er))
- self.assertEqual(url.url_is(par), er)
+ self.assertEqual(url.url_file(par), er)
testdata = yaml.load(open('test_rsync_url.yaml'))
diff --git a/test_rsync_url.yaml b/test_rsync_url.yaml
index b27f9e7..4342b8c 100644
--- a/test_rsync_url.yaml
+++ b/test_rsync_url.yaml
@@ -28,13 +28,13 @@
'/': '/'
'/first/level/': '/first/level'
'first/level': 'first/level'
- url_in:
+ url_dir:
null: 'ubuntu@172.18.66.89:~/'
'': 'ubuntu@172.18.66.89:~/'
'/': 'ubuntu@172.18.66.89:~/'
'/first/level/': 'ubuntu@172.18.66.89:~/first/level/'
'first/level': 'ubuntu@172.18.66.89:~/first/level/'
- url_is:
+ url_file:
null: 'ubuntu@172.18.66.89:~'
'': 'ubuntu@172.18.66.89:~'
'/': 'ubuntu@172.18.66.89:~'
@@ -58,13 +58,13 @@
'/': 'ubuntu@172.18.66.89:~/'
'/first/level/': 'ubuntu@172.18.66.89:~/first/level/'
'first/level': 'ubuntu@172.18.66.89:~/first/level'
- url_in:
+ url_dir:
null: 'ubuntu@172.18.66.89:~/'
'': 'ubuntu@172.18.66.89:~/'
'/': 'ubuntu@172.18.66.89:~/'
'/first/level/': 'ubuntu@172.18.66.89:~/first/level/'
'first/level': 'ubuntu@172.18.66.89:~/first/level/'
- url_is:
+ url_file:
null: 'ubuntu@172.18.66.89:~'
'': 'ubuntu@172.18.66.89:~'
'/': 'ubuntu@172.18.66.89:~'
@@ -88,13 +88,13 @@
'/': 'ubuntu@172.18.66.89:~/'
'/first/level/': 'ubuntu@172.18.66.89:~/first/level/'
'first/level': 'ubuntu@172.18.66.89:~/first/level'
- url_in:
+ url_dir:
null: 'ubuntu@172.18.66.89:~/'
'': 'ubuntu@172.18.66.89:~/'
'/': 'ubuntu@172.18.66.89:~/'
'/first/level/': 'ubuntu@172.18.66.89:~/first/level/'
'first/level': 'ubuntu@172.18.66.89:~/first/level/'
- url_is:
+ url_file:
null: 'ubuntu@172.18.66.89:~'
'': 'ubuntu@172.18.66.89:~'
'/': 'ubuntu@172.18.66.89:~'
@@ -118,13 +118,13 @@
'/': 'ubuntu@172.18.66.89:~/sub/dir/'
'/first/level/': 'ubuntu@172.18.66.89:~/sub/dir/first/level/'
'first/level': 'ubuntu@172.18.66.89:~/sub/dir/first/level'
- url_in:
+ url_dir:
null: 'ubuntu@172.18.66.89:~/sub/dir/'
'': 'ubuntu@172.18.66.89:~/sub/dir/'
'/': 'ubuntu@172.18.66.89:~/sub/dir/'
'/first/level/': 'ubuntu@172.18.66.89:~/sub/dir/first/level/'
'first/level': 'ubuntu@172.18.66.89:~/sub/dir/first/level/'
- url_is:
+ url_file:
null: 'ubuntu@172.18.66.89:~/sub/dir'
'': 'ubuntu@172.18.66.89:~/sub/dir'
'/': 'ubuntu@172.18.66.89:~/sub/dir'
@@ -148,13 +148,13 @@
'/': 'ubuntu@172.18.66.89:~/sub/dir/'
'/first/level/': 'ubuntu@172.18.66.89:~/sub/dir/first/level/'
'first/level': 'ubuntu@172.18.66.89:~/sub/dir/first/level'
- url_in:
+ url_dir:
null: 'ubuntu@172.18.66.89:~/sub/dir/'
'': 'ubuntu@172.18.66.89:~/sub/dir/'
'/': 'ubuntu@172.18.66.89:~/sub/dir/'
'/first/level/': 'ubuntu@172.18.66.89:~/sub/dir/first/level/'
'first/level': 'ubuntu@172.18.66.89:~/sub/dir/first/level/'
- url_is:
+ url_file:
null: 'ubuntu@172.18.66.89:~/sub/dir'
'': 'ubuntu@172.18.66.89:~/sub/dir'
'/': 'ubuntu@172.18.66.89:~/sub/dir'
@@ -178,13 +178,13 @@
'/': 'ubuntu@172.18.66.89:/'
'/first/level/': 'ubuntu@172.18.66.89:/first/level/'
'first/level': 'ubuntu@172.18.66.89:/first/level'
- url_in:
+ url_dir:
null: 'ubuntu@172.18.66.89:/'
'': 'ubuntu@172.18.66.89:/'
'/': 'ubuntu@172.18.66.89:/'
'/first/level/': 'ubuntu@172.18.66.89:/first/level/'
'first/level': 'ubuntu@172.18.66.89:/first/level/'
- url_is:
+ url_file:
null: 'ubuntu@172.18.66.89:/'
'': 'ubuntu@172.18.66.89:/'
'/': 'ubuntu@172.18.66.89:/'
@@ -257,13 +257,13 @@
'/': 'johnivanov@172.18.66.89::mirror-sync/otlichniy/reg/exp/'
'/first/level/': 'johnivanov@172.18.66.89::mirror-sync/otlichniy/reg/exp/first/level/'
'first/level': 'johnivanov@172.18.66.89::mirror-sync/otlichniy/reg/exp/first/level'
- url_in:
+ url_dir:
null: 'johnivanov@172.18.66.89::mirror-sync/otlichniy/reg/exp/'
'': 'johnivanov@172.18.66.89::mirror-sync/otlichniy/reg/exp/'
'/': 'johnivanov@172.18.66.89::mirror-sync/otlichniy/reg/exp/'
'/first/level/': 'johnivanov@172.18.66.89::mirror-sync/otlichniy/reg/exp/first/level/'
'first/level': 'johnivanov@172.18.66.89::mirror-sync/otlichniy/reg/exp/first/level/'
- url_is:
+ url_file:
null: 'johnivanov@172.18.66.89::mirror-sync/otlichniy/reg/exp'
'': 'johnivanov@172.18.66.89::mirror-sync/otlichniy/reg/exp'
'/': 'johnivanov@172.18.66.89::mirror-sync/otlichniy/reg/exp'
@@ -366,13 +366,13 @@
'/': 'rsync://mirror-sync@172.18.66.89:7327/otlichniy/reg/exp/'
'/first/level/': 'rsync://mirror-sync@172.18.66.89:7327/otlichniy/reg/exp/first/level/'
'first/level': 'rsync://mirror-sync@172.18.66.89:7327/otlichniy/reg/exp/first/level'
- url_in:
+ url_dir:
null: 'rsync://mirror-sync@172.18.66.89:7327/otlichniy/reg/exp/'
'': 'rsync://mirror-sync@172.18.66.89:7327/otlichniy/reg/exp/'
'/': 'rsync://mirror-sync@172.18.66.89:7327/otlichniy/reg/exp/'
'/first/level/': 'rsync://mirror-sync@172.18.66.89:7327/otlichniy/reg/exp/first/level/'
'first/level': 'rsync://mirror-sync@172.18.66.89:7327/otlichniy/reg/exp/first/level/'
- url_is:
+ url_file:
null: 'rsync://mirror-sync@172.18.66.89:7327/otlichniy/reg/exp'
'': 'rsync://mirror-sync@172.18.66.89:7327/otlichniy/reg/exp'
'/': 'rsync://mirror-sync@172.18.66.89:7327/otlichniy/reg/exp'
@@ -468,13 +468,13 @@
'/': '/'
'/first/level/': '/first/level/'
'first/level': '/first/level'
- url_in:
+ url_dir:
null: '/'
'': '/'
'/': '/'
'/first/level/': '/first/level/'
'first/level': '/first/level/'
- url_is:
+ url_file:
null: '/'
'': '/'
'/': '/'