Skip to content

Commit

Permalink
Updated integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
CorvusPrudens committed Aug 15, 2023
1 parent 27d65d3 commit e575e83
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 44 deletions.
14 changes: 7 additions & 7 deletions tests/data/integration/expected_field.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,13 @@ struct DaisyField {

// Display

daisy::OledDisplay<daisy::SSD130x4WireSpi128x64Driver>::Config display_config;
display_config.driver_config.transport_config.Defaults();

display.Init(display_config);
display.Fill(0);
display.Update();

daisy::OledDisplay<daisy::SSD130x4WireSpi128x64Driver>::Config display_config;
display_config.driver_config.transport_config.Defaults();
display.Init(display_config);
display.Fill(0);
display.Update();

som.adc.Start();
}
Expand Down
14 changes: 7 additions & 7 deletions tests/data/integration/expected_patch.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@ struct DaisyPatch {

// Display

daisy::OledDisplay<daisy::SSD130x4WireSpi128x64Driver>::Config display_config;
display_config.driver_config.transport_config.Defaults();

display.Init(display_config);
display.Fill(0);
display.Update();

daisy::OledDisplay<daisy::SSD130x4WireSpi128x64Driver>::Config display_config;
display_config.driver_config.transport_config.Defaults();
display.Init(display_config);
display.Fill(0);
display.Update();

// External Codec Initialization
daisy::SaiHandle::Config sai_config[2];
Expand Down
14 changes: 7 additions & 7 deletions tests/data/integration/expected_pod.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ struct DaisyPod {

// Display

daisy::OledDisplay<daisy::SSD130x4WireSpi128x64Driver>::Config display_config;
display_config.driver_config.transport_config.Defaults();

display.Init(display_config);
display.Fill(0);
display.Update();

daisy::OledDisplay<daisy::SSD130x4WireSpi128x64Driver>::Config display_config;
display_config.driver_config.transport_config.Defaults();
display.Init(display_config);
display.Fill(0);
display.Update();

som.adc.Start();
}
Expand Down
33 changes: 10 additions & 23 deletions tests/integration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,6 @@


class TestIntegration(unittest.TestCase):
__test__ = False

def test_custom(self):
self.maxDiff = None
header, info = json2daisy.generate_header_from_name('custom')
with open(path.join(data_path, 'integration', 'expected_custom.h'), 'r') as file:
self.assertEqual(header, file.read(), 'The output string should match "expected_custom.h" exactly')

def test_petal(self):
self.maxDiff = None
header, info = json2daisy.generate_header_from_name('petal')
with open(path.join(data_path, 'integration', 'expected_petal.h'), 'r') as file:
self.assertEqual(header, file.read(), 'The output string should match "expected_petal.h" exactly')

def test_patch(self):
self.maxDiff = None
Expand All @@ -38,26 +25,26 @@ def test_patch_init(self):
with open(path.join(data_path, 'integration', 'expected_patch_init.h'), 'r') as file:
self.assertEqual(header, file.read(), 'The output string should match "expected_patch_init.h" exactly')

def test_field(self):
def test_petal(self):
self.maxDiff = None
header, info = json2daisy.generate_header_from_name('field')
with open(path.join(data_path, 'integration', 'expected_field.h'), 'r') as file:
self.assertEqual(header, file.read(), 'The output string should match "expected_field.h" exactly')
header, info = json2daisy.generate_header_from_name('petal')
with open(path.join(data_path, 'integration', 'expected_petal.h'), 'r') as file:
self.assertEqual(header, file.read(), 'The output string should match "expected_petal.h" exactly')

def test_petal_125b_sm(self):
self.maxDiff = None
header, info = json2daisy.generate_header_from_name('petal_125b_sm')
with open(path.join(data_path, 'integration', 'expected_petal_125b_sm.h'), 'r') as file:
self.assertEqual(header, file.read(), 'The output string should match "expected_petal_125b_sm.h" exactly')

def test_petal_125b_sm(self):
self.maxDiff = None
header, info = json2daisy.generate_header_from_name('petal_125b_sm')
with open(path.join(data_path, 'integration', 'expected_petal_125b_sm.h'), 'r') as file:
self.assertEqual(header, file.read(), 'The output string should match "expected_petal_125b_sm.h" exactly')

def test_pod(self):
self.maxDiff = None
header, info = json2daisy.generate_header_from_name('pod')
with open(path.join(data_path, 'integration', 'expected_pod.h'), 'r') as file:
self.assertEqual(header, file.read(), 'The output string should match "expected_pod.h" exactly')

def test_field(self):
self.maxDiff = None
header, info = json2daisy.generate_header_from_name('field')
with open(path.join(data_path, 'integration', 'expected_field.h'), 'r') as file:
self.assertEqual(header, file.read(), 'The output string should match "expected_field.h" exactly')

0 comments on commit e575e83

Please sign in to comment.