diff --git a/LICENSE b/LICENSE index d64569567..fcfaa50a9 100644 --- a/LICENSE +++ b/LICENSE @@ -200,3 +200,29 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. + + +=============================================================================== +License for angular +=============================================================================== +The MIT License + +Copyright (c) 2010-2022 Google LLC. https://angular.io/license + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/examples/__init__.py b/examples/__init__.py index bb488a813..6d6d1266c 100644 --- a/examples/__init__.py +++ b/examples/__init__.py @@ -11,4 +11,3 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - diff --git a/openhtf/core/__init__.py b/openhtf/core/__init__.py index bb488a813..6d6d1266c 100644 --- a/openhtf/core/__init__.py +++ b/openhtf/core/__init__.py @@ -11,4 +11,3 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - diff --git a/openhtf/core/phase_branches.py b/openhtf/core/phase_branches.py index 05f6746ec..d498bc427 100644 --- a/openhtf/core/phase_branches.py +++ b/openhtf/core/phase_branches.py @@ -56,7 +56,7 @@ class PreviousPhases(enum.Enum): ALL = 'ALL' # Check all previous phases in the current subtest. - SUBTEST = "SUBTEST" + SUBTEST = 'SUBTEST' def _not_any(iterable: Iterator[bool]) -> bool: @@ -183,9 +183,9 @@ def apply_to_all_phases( return self def get_result( - self, - running_test_state: 'test_state.TestState', - subtest_rec: Optional[test_record.SubtestRecord] = None + self, + running_test_state: 'test_state.TestState', + subtest_rec: Optional[test_record.SubtestRecord] = None ) -> phase_descriptor.PhaseReturnT: if self._check_for_action(running_test_state, subtest_rec): return self.action @@ -193,10 +193,9 @@ def get_result( @abc.abstractmethod def _check_for_action( - self, - running_test_state: 'test_state.TestState', - subtest_rec: Optional[test_record.SubtestRecord] = None - ) -> bool: + self, + running_test_state: 'test_state.TestState', + subtest_rec: Optional[test_record.SubtestRecord] = None) -> bool: """Returns True when the action should be taken.""" @abc.abstractmethod @@ -244,20 +243,19 @@ def _phase_failed(self, phase_rec: test_record.PhaseRecord) -> bool: return phase_rec.outcome == test_record.PhaseOutcome.FAIL def _check_for_action( - self, - running_test_state: 'test_state.TestState', - subtest_rec: Optional[test_record.SubtestRecord] = None - ) -> bool: + self, + running_test_state: 'test_state.TestState', + subtest_rec: Optional[test_record.SubtestRecord] = None) -> bool: """Returns True when the specific set of phases fail.""" phase_records = running_test_state.test_record.phases if not phase_records: raise NoPhasesFoundError('No phases found in the test record.') if self.previous_phases_to_check == PreviousPhases.LAST: return self._phase_failed(phase_records[-1]) - elif (self.previous_phases_to_check == PreviousPhases.SUBTEST and + elif (self.previous_phases_to_check == PreviousPhases.SUBTEST and subtest_rec is not None): for phase_rec in phase_records: - if (phase_rec.subtest_name == subtest_rec.name and + if (phase_rec.subtest_name == subtest_rec.name and self._phase_failed(phase_rec)): return True else: @@ -286,10 +284,9 @@ def _asdict(self) -> Dict[Text, Any]: return ret def _check_for_action( - self, - running_test_state: 'test_state.TestState', - subtest_rec: Optional[test_record.SubtestRecord] = None - ) -> bool: + self, + running_test_state: 'test_state.TestState', + subtest_rec: Optional[test_record.SubtestRecord] = None) -> bool: """Returns True if the condition is true.""" return self.diag_condition.check(running_test_state.diagnoses_manager.store) diff --git a/openhtf/output/__init__.py b/openhtf/output/__init__.py index bb488a813..6d6d1266c 100644 --- a/openhtf/output/__init__.py +++ b/openhtf/output/__init__.py @@ -11,4 +11,3 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - diff --git a/openhtf/output/proto/__init__.py b/openhtf/output/proto/__init__.py index bb488a813..6d6d1266c 100644 --- a/openhtf/output/proto/__init__.py +++ b/openhtf/output/proto/__init__.py @@ -11,4 +11,3 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - diff --git a/openhtf/output/servers/__init__.py b/openhtf/output/servers/__init__.py index bb488a813..6d6d1266c 100644 --- a/openhtf/output/servers/__init__.py +++ b/openhtf/output/servers/__init__.py @@ -11,4 +11,3 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - diff --git a/openhtf/output/web_gui/__init__.py b/openhtf/output/web_gui/__init__.py index bb488a813..6d6d1266c 100644 --- a/openhtf/output/web_gui/__init__.py +++ b/openhtf/output/web_gui/__init__.py @@ -11,4 +11,3 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - diff --git a/openhtf/plugs/generic/__init__.py b/openhtf/plugs/generic/__init__.py index bb488a813..6d6d1266c 100644 --- a/openhtf/plugs/generic/__init__.py +++ b/openhtf/plugs/generic/__init__.py @@ -11,4 +11,3 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - diff --git a/pylint_plugins/__init__.py b/pylint_plugins/__init__.py index bb488a813..6d6d1266c 100644 --- a/pylint_plugins/__init__.py +++ b/pylint_plugins/__init__.py @@ -11,4 +11,3 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - diff --git a/test/core/phase_branches_test.py b/test/core/phase_branches_test.py index da75b2e1b..5dc53a238 100644 --- a/test/core/phase_branches_test.py +++ b/test/core/phase_branches_test.py @@ -450,8 +450,7 @@ def test_last_fail_subtest__fail_in_subtest(self): @htf_test.yields_phases def test_subtest_previous_fail__fail(self): test_rec = yield htf.Test( - fail_phase, - phase0, + fail_phase, phase0, phase_branches.PhaseFailureCheckpoint.subtest_previous( 'subtest_previous_fail', action=htf.PhaseResult.STOP), error_phase) @@ -467,16 +466,14 @@ def test_subtest_previous_fail__fail(self): action=htf.PhaseResult.STOP, conditional=phase_branches.PreviousPhases.SUBTEST, subtest_name=None, - result=phase_executor.PhaseExecutionOutcome( - htf.PhaseResult.STOP), + result=phase_executor.PhaseExecutionOutcome(htf.PhaseResult.STOP), evaluated_millis=htf_test.VALID_TIMESTAMP), ], test_rec.checkpoints) @htf_test.yields_phases def test_subtest_previous_fail__pass(self): test_rec = yield htf.Test( - phase0, - phase1, + phase0, phase1, phase_branches.PhaseFailureCheckpoint.subtest_previous( 'subtest_previous_pass', action=htf.PhaseResult.STOP), phase2) @@ -500,11 +497,13 @@ def test_subtest_previous_fail__fail_in_subtest(self): test_rec = yield htf.Test( phase0, htf.Subtest( - 'sub', fail_phase, phase1, - phase_branches.PhaseFailureCheckpoint.subtest_previous( - 'subtest_previous_fail_in_subtest', action=htf.PhaseResult.STOP), - ), - error_phase) + 'sub', + fail_phase, + phase1, + phase_branches.PhaseFailureCheckpoint.subtest_previous( + 'subtest_previous_fail_in_subtest', + action=htf.PhaseResult.STOP), + ), error_phase) self.assertTestFail(test_rec) self.assertPhasesOutcomeByName(test_record.PhaseOutcome.PASS, test_rec, @@ -518,8 +517,7 @@ def test_subtest_previous_fail__fail_in_subtest(self): action=htf.PhaseResult.STOP, conditional=phase_branches.PreviousPhases.SUBTEST, subtest_name='sub', - result=phase_executor.PhaseExecutionOutcome( - htf.PhaseResult.STOP), + result=phase_executor.PhaseExecutionOutcome(htf.PhaseResult.STOP), evaluated_millis=htf_test.VALID_TIMESTAMP), ], test_rec.checkpoints) @@ -528,12 +526,13 @@ def test_subtest_previous_fail__fail_out_of_subtest(self): test_rec = yield htf.Test( fail_phase, htf.Subtest( - 'sub', phase0, - phase_branches.PhaseFailureCheckpoint.subtest_previous( - 'subtest_previous_fail_out_of_subtest', action=htf.PhaseResult.STOP), - phase1, - ), - phase2) + 'sub', + phase0, + phase_branches.PhaseFailureCheckpoint.subtest_previous( + 'subtest_previous_fail_out_of_subtest', + action=htf.PhaseResult.STOP), + phase1, + ), phase2) self.assertTestFail(test_rec) self.assertPhasesOutcomeByName(test_record.PhaseOutcome.PASS, test_rec, @@ -557,10 +556,12 @@ def test_subtest_previous_fail__pass_in_subtest(self): test_rec = yield htf.Test( phase0, htf.Subtest( - 'sub', phase1, - phase_branches.PhaseFailureCheckpoint.subtest_previous( - 'subtest_previous_pass_in_subtest', action=htf.PhaseResult.STOP), - phase2, + 'sub', + phase1, + phase_branches.PhaseFailureCheckpoint.subtest_previous( + 'subtest_previous_pass_in_subtest', + action=htf.PhaseResult.STOP), + phase2, ), phase3) self.assertTestPass(test_rec) @@ -585,19 +586,22 @@ def test_subtest_previous_fail_subtest__fail_in_subtest(self): test_rec = yield htf.Test( phase0, htf.Subtest( - 'sub', fail_phase, phase1, - phase_branches.PhaseFailureCheckpoint.subtest_previous( - 'subtest_previous_fail_subtest_in_subtest', action=htf.PhaseResult.FAIL_SUBTEST), - skip0, - ), - phase2) + 'sub', + fail_phase, + phase1, + phase_branches.PhaseFailureCheckpoint.subtest_previous( + 'subtest_previous_fail_subtest_in_subtest', + action=htf.PhaseResult.FAIL_SUBTEST), + skip0, + ), phase2) self.assertTestFail(test_rec) self.assertPhasesOutcomeByName(test_record.PhaseOutcome.PASS, test_rec, 'phase0', 'phase1', 'phase2') self.assertPhasesOutcomeByName(test_record.PhaseOutcome.FAIL, test_rec, 'fail_phase') - self.assertPhasesOutcomeByName(test_record.PhaseOutcome.SKIP, test_rec, 'skip0') + self.assertPhasesOutcomeByName(test_record.PhaseOutcome.SKIP, test_rec, + 'skip0') self.assertEqual([ test_record.CheckpointRecord(