Skip to content

Commit

Permalink
Add simple test
Browse files Browse the repository at this point in the history
  • Loading branch information
tiadams committed Dec 21, 2023
1 parent 91259f6 commit 2fd7049
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/resources/real.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
A, B, C
1, 2, 3
0.8, 1.8, 3.2
0.5, 1.7, 3.1
4 changes: 4 additions & 0 deletions tests/resources/synthetic.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
A, B, C
1.1, 2.1, 3.1
0.7, 1.7, 3
0.6, 1.8, 2.9
18 changes: 18 additions & 0 deletions tests/test_jsd.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import os
from unittest import TestCase

import pandas as pd

from syndat.quality import get_jsd


class Test(TestCase):

TEST_DIR_PATH = os.path.dirname(os.path.realpath(__file__))

real = pd.read_csv(os.path.join(TEST_DIR_PATH, "resources", 'real.csv'))
synthetic = pd.read_csv(os.path.join(TEST_DIR_PATH, "resources", 'synthetic.csv'))

def test_get_jsd_avg(self):
jsd = get_jsd(self.real, self.synthetic)
self.assertEqual(0, jsd)

0 comments on commit 2fd7049

Please sign in to comment.