-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathfeatures_tests_cdr_length.py
34 lines (26 loc) · 1.27 KB
/
features_tests_cdr_length.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import unittest
from abpytools import CDRLength
import os
class CDRLengthTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.ab_file = './tests/Data/chain_collection_heavy_2_sequences.json'
def test_CDRLength_instantiation(self):
cdr_length = CDRLength(path=self.ab_file)
self.assertIsInstance(cdr_length, CDRLength)
def test_CDRLength_plot_1(self):
# cannot test if plot works but can check if there is a file that is created
cdr_length = CDRLength(path=self.ab_file)
cdr_length.plot_cdr(save=True, plot_path='./tests', plot_name='TestCDR.png')
self.assertTrue(os.path.isfile('./tests/TestCDR.png'), True)
# def test_CDRLength_plot_2(self):
# # cannot test if plot works but can check if there is a file that is created
# cdr_length = CDRLength(path=self.ab_file, load=True)
# cdr_length.plot_cdr(only_cdr3=False, save=True, plot_path='./tests', plot_name='TestCDR2.png')
# self.assertTrue(os.path.isfile('./tests/TestCDR2.png'), True)
@classmethod
def tearDownClass(cls):
if os.path.isfile('./tests/TestCDR.png'):
os.remove('./tests/TestCDR.png')
if os.path.isfile('./tests/TestCDR2.png'):
os.remove('./tests/TestCDR2.png')