Beispiel #1
0
    def test_copy_collection_collision(self):
        child = MockObject('/path/to/src/child', copy=Mock())
        src = MockCollection('/path/to/src/', get_children=Mock(return_value=[child]), delete=Mock())
        dst = MockCollection('/path/to/dst/', create_collection=Mock())

        src.copy_collection(dst)

        self.assertEqual(dst.create_collection.call_count, 0)
        self.assertEqual(child.copy.call_args[0][0].path, ['path', 'to', 'dst', 'child'])
Beispiel #2
0
    def test_copy_collection_collision(self):
        child = MockObject('/path/to/src/child', copy=Mock())
        src = MockCollection('/path/to/src/',
                             get_children=Mock(return_value=[child]),
                             delete=Mock())
        dst = MockCollection('/path/to/dst/', create_collection=Mock())

        src.copy_collection(dst)

        self.assertEqual(dst.create_collection.call_count, 0)
        self.assertEqual(child.copy.call_args[0][0].path,
                         ['path', 'to', 'dst', 'child'])