Esempio n. 1
0
 def test_tag_id_empty(self):
     dbStub.reset()
     dbStub.addResult([])
     t = Tags()
     tag_id = t.tag_id('testi')
     self.assertEquals(tag_id, None)
     self.assertTrue(dbStub.closed)
Esempio n. 2
0
 def test_build_cloud_empty(self):
     dbStub.reset()
     dbStub.addResult([])
     t = Tags()
     data = t.build_cloud()
     self.assertFalse(data)
     self.assertTrue(dbStub.closed)
Esempio n. 3
0
 def test_build_project_tags_empty(self):
     dbStub.reset()
     dbStub.addResult([])
     t = Tags()
     data = t.build_project_tags(0)
     self.assertFalse(data)
     self.assertTrue(dbStub.closed)
Esempio n. 4
0
 def test_tag_id_empty(self):
     dbStub.reset()
     dbStub.addResult([])
     t = Tags()
     tag_id = t.tag_id('testi')
     self.assertEquals(tag_id, None)
     self.assertTrue(dbStub.closed)
Esempio n. 5
0
 def test_build_project_tags_empty(self):
     dbStub.reset()
     dbStub.addResult([])
     t = Tags()
     data = t.build_project_tags(0)
     self.assertFalse(data)
     self.assertTrue(dbStub.closed)
Esempio n. 6
0
 def test_build_cloud_empty(self):
     dbStub.reset()
     dbStub.addResult([])
     t = Tags()
     data = t.build_cloud()
     self.assertFalse(data)
     self.assertTrue(dbStub.closed)
Esempio n. 7
0
    def test_build_project_tags(self):
        t = Tags()
        data = t.build_project_tags(0)

        self.assertTrue(data)
        self.assertEquals(len(data), 3)
        for row in data:
            self.assertIn(row['name'], ('joo', 'ei', 'kissanviikset'))
            self.assertIn(row['count'], (150, 30, 1))

        self.assertTrue(dbStub.closed)
Esempio n. 8
0
    def test_build_project_tags(self):
        t = Tags()
        data = t.build_project_tags(0)

        self.assertTrue(data)
        self.assertEquals(len(data), 3)
        for row in data:
            self.assertIn(row['name'], ('joo', 'ei', 'kissanviikset'))
            self.assertIn(row['count'], (150, 30, 1))

        self.assertTrue(dbStub.closed)
Esempio n. 9
0
    def test_build_cloud(self):
        t = Tags()
        data = t.build_cloud()

        self.assertTrue(data)
        self.assertEquals(len(data), 3)
        for row in data:
            self.assertIn(row['name'], ('joo', 'ei', 'kissanviikset'))
            self.assertIn(row['count'], (150, 30, 1))
        # Font size should scale from 8 to 32. List is ordered alphabetically by tag name.
        self.assertTrue(8 < int(data[0]['font_size']) < 32)
        self.assertEquals(int(data[1]['font_size']), 32)
        self.assertEquals(int(data[2]['font_size']), 8)

        self.assertTrue(dbStub.closed)
Esempio n. 10
0
    def test_build_cloud(self):
        t = Tags()
        data = t.build_cloud()

        self.assertTrue(data)
        self.assertEquals(len(data), 3)
        for row in data:
            self.assertIn(row['name'], ('joo', 'ei', 'kissanviikset'))
            self.assertIn(row['count'], (150, 30, 1))
        # Font size should scale from 8 to 32. List is ordered alphabetically by tag name.
        self.assertTrue(8 < int(data[0]['font_size']) < 32)
        self.assertEquals(int(data[1]['font_size']), 32)
        self.assertEquals(int(data[2]['font_size']), 8)

        self.assertTrue(dbStub.closed)
Esempio n. 11
0
 def test_tag_count(self):
     t = Tags()
     tag_count = t.tag_count(0)
     self.assertEquals(tag_count, 1)
     self.assertTrue(dbStub.closed)
Esempio n. 12
0
 def test_create(self):
     t = Tags()
     tag_id = t.create('testi')
     self.assertTrue(tag_id)
     self.assertTrue(dbStub.closed)
Esempio n. 13
0
 def test_remove(self):
     t = Tags()
     ret = t.remove(1, 'joo')
     self.assertTrue(ret)
     self.assertTrue(dbStub.closed)
Esempio n. 14
0
 def test_add(self):
     t = Tags()
     ret = t.add(1, 'testi')
     self.assertTrue(ret)
     self.assertTrue(dbStub.closed)
Esempio n. 15
0
 def test_remove(self):
     t = Tags()
     ret = t.remove(1, 'joo')
     self.assertTrue(ret)
     self.assertTrue(dbStub.closed)
Esempio n. 16
0
 def test_add(self):
     t = Tags()
     ret = t.add(1, 'testi')
     self.assertTrue(ret)
     self.assertTrue(dbStub.closed)
Esempio n. 17
0
 def test_create(self):
     t = Tags()
     tag_id = t.create('testi')
     self.assertTrue(tag_id)
     self.assertTrue(dbStub.closed)
Esempio n. 18
0
 def test_tag_count(self):
     t = Tags()
     tag_count = t.tag_count(0)
     self.assertEquals(tag_count, 1)
     self.assertTrue(dbStub.closed)