|
3 | 3 |
|
4 | 4 | from __future__ import absolute_import, print_function
|
5 | 5 | import unittest
|
6 |
| -import json |
7 | 6 | from tests import fixtures
|
8 | 7 | from skinfer import schema_inferer
|
9 |
| -from subprocess import check_output |
10 | 8 |
|
11 | 9 |
|
12 | 10 | class TestJsonSchemaInferer(unittest.TestCase):
|
@@ -37,47 +35,3 @@ def test_load_jsonlines_samples(self):
|
37 | 35 |
|
38 | 36 | # then:
|
39 | 37 | self.assertEquals(3, len(samples))
|
40 |
| - |
41 |
| - |
42 |
| -class TestCasePython26Shim(unittest.TestCase): |
43 |
| - def assertIsNotNone(self, value): |
44 |
| - self.assertFalse(value is None, "%r is not None" % value) |
45 |
| - |
46 |
| - def assertIn(self, value, seq): |
47 |
| - self.assertTrue(value in seq, "%r is not in %r" % (value, seq)) |
48 |
| - |
49 |
| - |
50 |
| -class TestSchemaInfererScriptTest(TestCasePython26Shim): |
51 |
| - def test_run_with_json_samples_in_separate_files(self): |
52 |
| - # given: |
53 |
| - sample1 = fixtures.get_sample_path('minimal-1.json') |
54 |
| - sample2 = fixtures.get_sample_path('sample2-yelp.json') |
55 |
| - # when: |
56 |
| - output = check_output(['bin/schema_inferer', sample1, sample2]) |
57 |
| - # then: |
58 |
| - data = json.loads(output) |
59 |
| - self.assertIsNotNone(data) |
60 |
| - self.assertIn('required', data) |
61 |
| - self.assertIn('properties', data) |
62 |
| - |
63 |
| - def test_run_with_jsonlines_samples(self): |
64 |
| - # given: |
65 |
| - infile = fixtures.get_sample_path('jsonlines.jsonl') |
66 |
| - # when: |
67 |
| - output = check_output(['bin/schema_inferer', '--jsonlines', infile]) |
68 |
| - # then: |
69 |
| - data = json.loads(output) |
70 |
| - self.assertIsNotNone(data) |
71 |
| - self.assertIn('required', data) |
72 |
| - self.assertIn('properties', data) |
73 |
| - |
74 |
| - def test_run_with_jsonlines_samples_omitting_option(self): |
75 |
| - # given: |
76 |
| - infile = fixtures.get_sample_path('jsonlines.jsonl') |
77 |
| - # when: |
78 |
| - output = check_output(['bin/schema_inferer', infile]) |
79 |
| - # then: |
80 |
| - data = json.loads(output) |
81 |
| - self.assertIsNotNone(data) |
82 |
| - self.assertIn('required', data) |
83 |
| - self.assertIn('properties', data) |
0 commit comments