예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #11
0
 def test_tag_count(self):
     t = Tags()
     tag_count = t.tag_count(0)
     self.assertEquals(tag_count, 1)
     self.assertTrue(dbStub.closed)
예제 #12
0
 def test_create(self):
     t = Tags()
     tag_id = t.create('testi')
     self.assertTrue(tag_id)
     self.assertTrue(dbStub.closed)
예제 #13
0
 def test_remove(self):
     t = Tags()
     ret = t.remove(1, 'joo')
     self.assertTrue(ret)
     self.assertTrue(dbStub.closed)
예제 #14
0
 def test_add(self):
     t = Tags()
     ret = t.add(1, 'testi')
     self.assertTrue(ret)
     self.assertTrue(dbStub.closed)
예제 #15
0
 def test_remove(self):
     t = Tags()
     ret = t.remove(1, 'joo')
     self.assertTrue(ret)
     self.assertTrue(dbStub.closed)
예제 #16
0
 def test_add(self):
     t = Tags()
     ret = t.add(1, 'testi')
     self.assertTrue(ret)
     self.assertTrue(dbStub.closed)
예제 #17
0
 def test_create(self):
     t = Tags()
     tag_id = t.create('testi')
     self.assertTrue(tag_id)
     self.assertTrue(dbStub.closed)
예제 #18
0
 def test_tag_count(self):
     t = Tags()
     tag_count = t.tag_count(0)
     self.assertEquals(tag_count, 1)
     self.assertTrue(dbStub.closed)