Skip to content
Snippets Groups Projects
test_depends.py 897 B
Newer Older
  • Learn to ignore specific revisions
  • from b_asic import Addition, Butterfly
    
    class TestDepends:
        def test_depends_addition(self):
            add1 = Addition()
            assert set(add1.inputs_required_for_output(0)) == {0, 1}
    
        def test_depends_butterfly(self):
            bfly1 = Butterfly()
            assert set(bfly1.inputs_required_for_output(0)) == {0, 1}
            assert set(bfly1.inputs_required_for_output(1)) == {0, 1}
    
        def test_depends_sfg(self, sfg_two_inputs_two_outputs):
            assert set(sfg_two_inputs_two_outputs.inputs_required_for_output(0)) == {0, 1}
            assert set(sfg_two_inputs_two_outputs.inputs_required_for_output(1)) == {0, 1}
    
        def test_depends_sfg_independent(self, sfg_two_inputs_two_outputs_independent):
            assert set(sfg_two_inputs_two_outputs_independent.inputs_required_for_output(0)) == {0}
            assert set(sfg_two_inputs_two_outputs_independent.inputs_required_for_output(1)) == {1}