Code Duplication    Length = 25-26 lines in 3 locations

tests/test_calc.py 1 location

@@ 5-30 (lines=26) @@
2
# 
3
#    Licensed under the Apache License, Version 2.0 (the "License");
4
#    you may not use this file except in compliance with the License.
5
#    You may obtain a copy of the License at
6
# 
7
#        http://www.apache.org/licenses/LICENSE-2.0
8
# 
9
#    Unless required by applicable law or agreed to in writing, software
10
#    distributed under the License is distributed on an "AS IS" BASIS,
11
#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
#    See the License for the specific language governing permissions and
13
#    limitations under the License.
14
15
import unittest
16
from api import message, plugin
17
from plugins import calc
18
19
import asyncio
20
21
class TestCalcSuite(unittest.TestCase):
22
23
    def test_calc_import(self):
24
        result = calc.onInit(__import__('api.plugin'))
25
        self.assertEqual(type(result), plugin.Plugin)
26
27
    def test_calc_empty_equ(self):
28
        msg = message.Message(body="")
29
        msg.command = "calc"
30
        result = yield from calc.onCommand(msg)
31
        self.assertEqual(type(result), type(msg))
32
33
    def test_calc_inval_equ(self):

tests/test_srcutils.py 1 location

@@ 5-29 (lines=25) @@
2
# 
3
#    Licensed under the Apache License, Version 2.0 (the "License");
4
#    you may not use this file except in compliance with the License.
5
#    You may obtain a copy of the License at
6
# 
7
#        http://www.apache.org/licenses/LICENSE-2.0
8
# 
9
#    Unless required by applicable law or agreed to in writing, software
10
#    distributed under the License is distributed on an "AS IS" BASIS,
11
#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
#    See the License for the specific language governing permissions and
13
#    limitations under the License.
14
15
import unittest
16
from api import message, plugin
17
from plugins import srcutils
18
19
class TestFunSuite(unittest.TestCase):
20
21
    def test_srcutils_import(self):
22
        result = srcutils.onInit(__import__('api.plugin'))
23
        self.assertEqual(type(result), plugin.Plugin)
24
25
    def test_srcutils_source(self):
26
        msg = message.Message(body="")
27
        msg.command = "source"
28
        result = yield from srcutils.onCommand(msg)
29
        self.assertEqual(type(result), type(msg))
30
31
    def test_srcutils_docs(self):
32
        msg = message.Message(body="")

tests/test_cacheutils.py 1 location

@@ 5-29 (lines=25) @@
2
# 
3
#    Licensed under the Apache License, Version 2.0 (the "License");
4
#    you may not use this file except in compliance with the License.
5
#    You may obtain a copy of the License at
6
# 
7
#        http://www.apache.org/licenses/LICENSE-2.0
8
# 
9
#    Unless required by applicable law or agreed to in writing, software
10
#    distributed under the License is distributed on an "AS IS" BASIS,
11
#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
#    See the License for the specific language governing permissions and
13
#    limitations under the License.
14
15
import unittest
16
from api import message, plugin
17
from plugins import cacheutils
18
19
class TestCacheSuite(unittest.TestCase):
20
21
    def test_srcutils_import(self):
22
        result = cacheutils.onInit(__import__('api.plugin'))
23
        self.assertEqual(type(result), plugin.Plugin)
24
25
    def test_cacheutils_cachecount(self):
26
        msg = message.Message(body="")
27
        msg.command = "cachecount"
28
        result = yield from cacheutils.onCommand(msg)
29
        self.assertEqual(type(result), type(msg))
30
31
    def test_cacheutils_caches(self):
32
        msg = message.Message(body="")