Completed
Pull Request — master (#2609)
by Udayan
02:12
created

ProjectWideBearTest.test_bear_executions()   A

Complexity

Conditions 1

Size

Total Lines 6

Duplication

Lines 6
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
dl 6
loc 6
rs 9.4285
1
import unittest
2
3
from coalib.bears.ProjectWideBear import BEAR_KIND, ProjectWideBear
4
from coalib.settings.Section import Section
5
6
7
class DummyFileProxy:
8
9
    def __init__(self, lines):
10
        self.lines = lines
11
12
13 View Code Duplication
class ProjectWideBearTest(unittest.TestCase):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
14
15
    def setUp(self):
16
        file_set = {DummyFileProxy([]), DummyFileProxy(["a\n"])}
17
        self.test_object = ProjectWideBear(file_set, Section("Name"), None)
18
19
    def test_api(self):
20
        test_object = ProjectWideBear(None, Section("name"), None)
21
        self.assertRaises(NotImplementedError,
22
                          test_object.analyze,
23
                          {})
24
25
    def test_kind(self):
26
        self.assertEqual(ProjectWideBear.kind(), BEAR_KIND.PROJECTWIDE)
27
28
    def test_bear_executions(self):
29
        task = self.test_object.generate_tasks()
30
        self.assertRaises(NotImplementedError,
31
                          self.test_object.execute_task,
32
                          task[0],
33
                          task[1])
34