Completed
Push — stable ( ce9d65...6568cb )
by Sydney
02:01 queued 01:19
created

TestFunSuite   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 100 %

Importance

Changes 5
Bugs 0 Features 0
Metric Value
wmc 4
c 5
b 0
f 0
dl 25
loc 25
rs 10

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
#    Copyright 2017 Starbot Discord Project
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 View Code Duplication
#    You may obtain a copy of the License at
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
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="")
33
        msg.command = "docs"
34
        result = yield from srcutils.onCommand(msg)
35
        self.assertEqual(type(result), type(msg))
36
37
    def test_srcutils_tests(self):
38
        msg = message.Message(body="")
39
        msg.command = "tests"
40
        result = yield from srcutils.onCommand(msg)
41
        self.assertEqual(type(result), type(msg))
42