def test_dbcopy_ruleset_create(self): uniargs = [u"testmmąöî", u"mmąöî666"] dgm_cli.dbcopy(self.db, self.config, uniargs) filepath = os.path.join(BASEDIR, u"mmąöî666.rs") assert os.path.exists(filepath) with open(filepath) as f1: with open(TESTFILE) as f2: assert f1.read() == f2.read()
def test_dbcopy_ruleset_nocreate(self): # Create a second rs uniargs_add = [u"mmąöî666", u"mmąöî", u"fake@mmąöî", u"mmąöî", u"mmąöî", \ u"mmąöî", u"mmąöî", u"mmąöî", u"mmąöî"] dgm_cli.dbadd(self.db, self.config, uniargs_add) # Empty second rs uniargs_rem = [u"-E", u"mmąöî666"] dgm_cli.dbremove(self.db, self.config, uniargs_rem) filepath = os.path.join(BASEDIR, u"mmąöî666.rs") # Test if still here and empty assert os.path.exists(filepath) with open(filepath) as f1: assert f1.read() == "" # Copy from test to second rs uniargs = [u"testmmąöî", u"mmąöî666"] dgm_cli.dbcopy(self.db, self.config, uniargs) with open(filepath) as f1: with open(TESTFILE) as f2: assert f1.read() == f2.read()