def test_simple(self):
d = [[1.04, 1.5, 2., 2.5, 1.18, 2.82, 2.96, 3., 1, 3., 1., 'S1'],
[1.04, 1.5, 2., 2.5, 1.18, 2.82, 2.96, 3., 1, 3., 1., 'S2'],
[1.04, 1.5, 2., 2.5, 1.18, 2.82, 2.96, 3., 1, 3., 1., 'S3']]
data = pd.DataFrame(data=d, columns=['2%', '25%', '50%', '75%', '9%',
'91%', '98%', 'count', 'depth',
'max', 'min', 'sample-id'])
with tempfile.TemporaryDirectory() as output_dir:
_alpha_rarefaction_jsonp(output_dir, 'peanut.jsonp', 'shannon',
data, '')
jsonp_fp = os.path.join(output_dir, 'peanut.jsonp')
self.assertTrue(os.path.exists(jsonp_fp))
jsonp_content = open(jsonp_fp).read()
self.assertTrue('load_data' in jsonp_content)
self.assertTrue('columns' in jsonp_content)
self.assertTrue('index' in jsonp_content)
self.assertTrue('data' in jsonp_content)
self.assertTrue('sample-id' in jsonp_content)
self.assertTrue('shannon' in jsonp_content)
评论列表
文章目录