Exemple #1
0
def test_get_parent_dir_doubleslash():
    cs = CauSync(config, "/tmp/causync_src", "/tmp/causync_dest", 'sync')

    assert_equals(cs.get_parent_dir('/tmp/causync_src/test//'),
                  '/tmp/causync_src')
    assert_equals(cs.get_parent_dir('/tmp//causync_src//test//'),
                  '/tmp/causync_src')
    assert_equals(cs.get_parent_dir('/tmp///causync_src/test'),
                  '/tmp/causync_src')
    assert_equals(cs.get_parent_dir('/tmp////causync_src/test'),
                  '/tmp/causync_src')
Exemple #2
0
def test_get_parent_dir():
    cs = CauSync(config, "/tmp/causync_src", "/tmp/causync_dest", 'sync')

    assert_equals(cs.get_parent_dir('/tmp/causync_src/test'),
                  '/tmp/causync_src')
    assert_equals(cs.get_parent_dir('/tmp/causync_src/test/'),
                  '/tmp/causync_src')
    assert_equals(cs.get_parent_dir('/tmp/causync_src'), '/tmp')
    assert_equals(cs.get_parent_dir('/tmp/causync_src/'), '/tmp')
    assert_equals(cs.get_parent_dir('/tmp'), '/')
    assert_equals(cs.get_parent_dir('/tmp/'), '/')
    assert_equals(cs.get_parent_dir('/'), '/')
Exemple #3
0
def test_get_parent_dir_toomuchroot2():
    cs = CauSync(config, "/tmp/causync_src", "/tmp/causync_dest", 'sync')
    cs.get_parent_dir('//')