GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — master ( cc6bfd...4f98db )
by Andreas
01:27
created

klib.tests.test_describe   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 22
dl 0
loc 32
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A Test_corr_mat.test_output_type() 0 4 1
A Test_corr_mat.test_output_shape() 0 4 1
A Test_corr_mat.setUpClass() 0 9 1
1
import numpy as np
2
import pandas as pd
3
import unittest
4
from klib.describe import corr_mat
5
# from klib.utils import _missing_vals
6
7
if __name__ == '__main__':
8
    unittest.main()
9
10
11
class Test_corr_mat(unittest.TestCase):
12
13
    @classmethod
14
    def setUpClass(cls):
15
        cls.data_corr_df = pd.DataFrame([[1, 0, 3, 4],
16
                                         [3, 4, 5, 6],
17
                                         ['a', 'b', pd.NA, 'd'],
18
                                         [5, False, np.nan, pd.NaT]],
19
                                        columns=['Col1', 'Col2', 'Col3', 'Col4'])
20
21
        cls.data_corr_list = [1, 2, -3, 4, 5, 0]
22
23
    def test_output_type(self):
24
        # Test conversion from pd.io.formats.style.Styler to pd.core.frame.DataFrame
25
        self.assertTrue(type(corr_mat(self.data_corr_df)), type(pd.DataFrame))
26
        self.assertTrue(type(corr_mat(self.data_corr_list)), type(pd.DataFrame))
27
28
    def test_output_shape(self):
29
        # Test for output of equal dimensions
30
        self.assertEqual(corr_mat(self.data_corr_df).data.shape[0], corr_mat(self.data_corr_df).data.shape[1])
31
        self.assertEqual(corr_mat(self.data_corr_list).data.shape[0], corr_mat(self.data_corr_list).data.shape[1])
32