Exemplo n.º 1
0
 def test_05ClearSingle(self):
     s = Sources(name="demo00", url="")
     s.add()
     res0 = s.findAllByName()
     res0[0].clearSingle()
     res1 = s.findAllByName()
     if len(res1) == 0:
         assert True
     else:
         assert False
Exemplo n.º 2
0
 def test_runMigrations(self):
     d = InitDb()
     d.runMigrations()
     s = Sources(name="test", url="www.python.com")
     s.add()
     res = s.findAllByName()
     assert len(res) == 1
Exemplo n.º 3
0
 def test_05clearTable(self):
     Sources().clearTable()
     s = Sources(name="Sources01")
     res = s.findAllByName()
     if len(res) == 0:
         assert True
     else:
         assert False
Exemplo n.º 4
0
    def test_01add01(self):
        s = Sources(name="", url="void")
        s.add()

        res = s.findAllByName()
        if res[0].name == "" and res[0].url == "void":
            s.clearTable()
            assert True
        else:
            assert False