示例#1
0
 def test_dbupdate_change_ruleset_name(self):
     uniargs = [u"testmmąöî", u"mmąöî", u"ruleset=updatemmąöî", \
                 u"comments=updatemmąöî"]
     dgm_cli.dbupdate(self.db, self.config, uniargs)
     filepath = os.path.join(BASEDIR, u"updatemmąöî.rs")
     assert os.path.exists(filepath)
     assert fetch_and_check(filepath, u"mmąöî", "comments", u"updatemmąöî")
     assert not fetch_and_check(TESTFILE, u"mmąöî", "comments", \
                 u"updatemmąöî")
示例#2
0
    def test_dbupdate_deps(self):
        # Add a rule that depends on the one in the test file (mmąöî)
        uniargs_add = [u"testmmąöî", u"mmąöî2", u"fake@mmąöî", u"mmąöî", \
                    u"mmąöî", u"mmąöî", u"mmąöî", u"mmąöî", u"mmąöî"]
        dgm_cli.dbadd(self.db, self.config, uniargs_add)

        # Update the name of the first one and update references
        uniargs = [u"testmmąöî", u"mmąöî", u"name=updatemmąöî"]
        dgm_cli.dbupdate(self.db, self.config, uniargs)
        assert not fetch_and_check(TESTFILE, u"mmąöî", "help", u"mmąöî")
        assert fetch_and_check(TESTFILE, u"updatemmąöî", "help", u"mmąöî")
        assert fetch_and_check(TESTFILE, u"mmąöî2", "dependson", u"updatemmąöî")
示例#3
0
    def test_dbupdate_nodeps(self):
        # Add a rule that depends on the one in the test file (mmąöî)
        uniargs_add = [u"testmmąöî", u"mmąöî2", u"fake@mmąöî", u"mmąöî", \
                    u"mmąöî", u"mmąöî", u"mmąöî", u"mmąöî", u"mmąöî"]
        dgm_cli.dbadd(self.db, self.config, uniargs_add)

        # Update the name of the first one and don't update references
        uniargs = [u"--nodeps", u"testmmąöî", u"mmąöî", u"name=updatemmąöî"]
        dgm_cli.dbupdate(self.db, self.config, uniargs)
        # TODO is this a bug? cf dgm.model:312. The tests should be:
        #assert not fetch_and_check(TESTFILE, u"mmąöî", "help", u"mmąöî")
        #assert fetch_and_check(TESTFILE, u"updatemmąöî", "help", u"mmąöî")
        #assert fetch_and_check(TESTFILE, u"mmąöî2", "dependson", u"mmąöî")
        assert fetch_and_check(TESTFILE, u"mmąöî", "help", u"mmąöî")
        assert fetch_and_check(TESTFILE, u"mmąöî2", "dependson", u"mmąöî")
示例#4
0
 def test_dbupdate(self):
     uniargs = [u"testmmąöî", u"mmąöî", u"help=updatemmąöî", \
                 u"comments=updatemmąöî"]
     dgm_cli.dbupdate(self.db, self.config, uniargs)
     assert fetch_and_check(TESTFILE, u"mmąöî", "help", u"updatemmąöî")
     assert fetch_and_check(TESTFILE, u"mmąöî", "comments", u"updatemmąöî")