Ejemplo n.º 1
0
 def setUp(self):
     super(TestOsfStorageFileTree, self).setUp()
     self.path = 'news/of/the/world'
     self.node_settings = model.OsfStorageNodeSettings()
     self.node_settings.save()
     self.tree = model.OsfStorageFileTree(
         path=self.path,
         node_settings=self.node_settings,
     )
     self.tree.save()
Ejemplo n.º 2
0
 def test_serialize_metadata_folder(self):
     file_tree = model.OsfStorageFileTree(
         path='god/save/the/queen',
         node_settings=self.project.get_addon('osfstorage'),
     )
     serialized = utils.serialize_metadata_hgrid(
         file_tree,
         self.project,
     )
     assert_equal(serialized['path'], 'god/save/the/queen')
     assert_equal(serialized['name'], 'queen')
     assert_equal(serialized['ext'], '')
     assert_equal(serialized['kind'], 'folder')
Ejemplo n.º 3
0
 def test_get_item_kind_folder(self):
     assert_equal(
         utils.get_item_kind(model.OsfStorageFileTree()),
         'folder',
     )