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

DummyFileProxy   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 4
Duplicated Lines 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
c 3
b 0
f 0
dl 0
loc 4
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __init__() 0 2 1
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