Exemplo n.º 1
0
 def test__batchy_update__add_key(self):
     files = _list_files(dirs=['files/people'])
     batchy_update('thing', 'TEST', files, add=True)
     docs = _read_files(TESTFILES)
     for doc in docs:
         if doc[RESERVED_FILE_KEY] in TESTFILES_PEOPLE:
             self.assertTrue('thing' in doc.keys())
             self.assertEqual(doc['thing'], 'TEST')
         else:
             self.assertFalse('thing' in doc.keys())
Exemplo n.º 2
0
 def test__utils__list_files__given_files_and_dirs(self):
     focus = ['files/people/bob.yml', 'files/people/jeff.yml']
     output = _list_files(files=focus, dirs=['files/animals'])
     output.sort()
     files = focus + TESTFILES_ANIMALS
     files.sort()
     print TESTFILES_ANIMALS
     print files
     print output
     self.assertEqual(files, output)
Exemplo n.º 3
0
 def test__utils__list_files__given_dirs(self):
     files = _list_files(dirs=['files/people'])
     files.sort()
     self.assertEqual(files, TESTFILES_PEOPLE)
Exemplo n.º 4
0
 def test__utils__list_files__given_files(self):
     focus = ['files/people/bob.yml', 'files/people/jeff.yml']
     files = _list_files(files=focus)
     files.sort()
     self.assertEqual(files, focus)
Exemplo n.º 5
0
 def test__utils__list_files__empty_lists(self):
     files = _list_files()
     files.sort()
     self.assertEqual(files, TESTFILES)