Exemple #1
0
 def test_escaped_uppercase(self):
     """Uppercase letters are escaped for safety on Windows"""
     my_store = store.TransportStore(MemoryTransport(),
                                     prefixed=True,
                                     escaped=True)
     # a particularly perverse file-id! :-)
     self.assertEquals(my_store._relpath('C:<>'), 'be/%2543%253a%253c%253e')
Exemple #2
0
 def test__relpath_prefixed_suffixed(self):
     my_store = store.TransportStore(MockTransport(), True)
     my_store.register_suffix('bar')
     my_store.register_suffix('baz')
     self.assertEqual('45/foo.baz', my_store._relpath('foo', ['baz']))
     self.assertEqual('45/foo.bar.baz',
                      my_store._relpath('foo', ['bar', 'baz']))
Exemple #3
0
 def test_relpath_escaped(self):
     my_store = store.TransportStore(MemoryTransport())
     self.assertEqual('%25', my_store._relpath('%'))
Exemple #4
0
 def test__relpath_prefixed(self):
     my_store = store.TransportStore(MockTransport(), True)
     self.assertEqual('45/foo', my_store._relpath('foo'))
Exemple #5
0
 def test__relpath_simple(self):
     my_store = store.TransportStore(MockTransport())
     self.assertEqual("foo", my_store._relpath('foo'))
Exemple #6
0
 def test__relpath_unregister_suffixes(self):
     my_store = store.TransportStore(MockTransport())
     self.assertRaises(ValueError, my_store._relpath, 'foo', ['gz'])
     self.assertRaises(ValueError, my_store._relpath, 'foo', ['dsc', 'gz'])
Exemple #7
0
 def test_register_invalid_suffixes(self):
     my_store = store.TransportStore(MockTransport())
     self.assertRaises(ValueError, my_store.register_suffix, '/')
     self.assertRaises(ValueError, my_store.register_suffix, '.gz/bar')
Exemple #8
0
 def test__relpath_invalid(self):
     my_store = store.TransportStore(MockTransport())
     self.assertRaises(ValueError, my_store._relpath, '/foo')
     self.assertRaises(ValueError, my_store._relpath, 'foo/')