def test_non_empty(self):
     """It should create zip-files by default."""
     create_test_data()
     tmpdir, zipfiles = backup._fetch_and_zip(es_url,
                                              'companiontest')
     self.assertEqual(len(zipfiles), 2)
     zip1 = os.path.join(tmpdir, 'companiontest_simple.zip')
     zip2 = os.path.join(tmpdir, 'companiontest_advanced.zip')
     self.assertIn(zip1, zipfiles)
     self.assertIn(zip2, zipfiles)
 def test_not_exists(self):
     """It should not crash on indexes that do not exist."""
     tmpdir, zipfiles = backup._fetch_and_zip(es_url,
                                              'fooindexname')
     self.assertIsNone(tmpdir)
     self.assertIsNone(zipfiles)