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