Skip to content

Commit

Permalink
ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
jackbdoughty committed Jan 2, 2025
1 parent c108920 commit 4671535
Showing 1 changed file with 9 additions and 28 deletions.
37 changes: 9 additions & 28 deletions test_genie_python_using_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from genie_python.genie_script_checker import ScriptChecker
from genie_python.testing_utils.script_checker import CreateTempScriptAndReturnErrors
from hamcrest import assert_that, is_, is_in

from utilities.utilities import (
check_block_exists,
g, # type: ignore
Expand Down Expand Up @@ -240,9 +239,7 @@ def test_GIVEN_waiting_for_exact_value_on_block_WHEN_block_reaches_value_THEN_wa
args=(self.wait_before, self.wait_after, self.pv_name, value_to_wait_for),
)
set_pv_thread.start()
g.waitfor_block(
block=self.block_name, value=value_to_wait_for, maxwait=self.max_wait
)
g.waitfor_block(block=self.block_name, value=value_to_wait_for, maxwait=self.max_wait)

assert_that(
set_pv_thread.is_alive(),
Expand All @@ -261,9 +258,7 @@ def test_GIVEN_waiting_for_exact_value_on_block_WHEN_block_wrong_value_THEN_time
args=(self.wait_before, self.wait_after, self.pv_name, wrong_value),
)
set_pv_thread.start()
g.waitfor_block(
block=self.block_name, value=value_to_wait_for, maxwait=self.max_wait
)
g.waitfor_block(block=self.block_name, value=value_to_wait_for, maxwait=self.max_wait)

assert_that(
set_pv_thread.is_alive(),
Expand Down Expand Up @@ -332,9 +327,7 @@ def test_GIVEN_waiting_for_value_below_high_limit_on_block_WHEN_block_enters_ran
args=(self.wait_before, self.wait_after, self.pv_name, value_in_range),
)
set_pv_thread.start()
g.waitfor_block(
block=self.block_name, highlimit=high_limit, maxwait=self.max_wait
)
g.waitfor_block(block=self.block_name, highlimit=high_limit, maxwait=self.max_wait)

assert_that(
set_pv_thread.is_alive(),
Expand All @@ -353,9 +346,7 @@ def test_GIVEN_waiting_for_value_below_high_limit_on_block_WHEN_block_above_limi
args=(self.wait_before, self.wait_after, self.pv_name, wrong_value),
)
set_pv_thread.start()
g.waitfor_block(
block=self.block_name, highlimit=high_limit, maxwait=self.max_wait
)
g.waitfor_block(block=self.block_name, highlimit=high_limit, maxwait=self.max_wait)

assert_that(
set_pv_thread.is_alive(),
Expand All @@ -374,9 +365,7 @@ def test_GIVEN_waiting_for_value_above_low_limit_on_block_WHEN_block_enters_rang
args=(self.wait_before, self.wait_after, self.pv_name, value_in_range),
)
set_pv_thread.start()
g.waitfor_block(
block=self.block_name, lowlimit=low_limit, maxwait=self.max_wait
)
g.waitfor_block(block=self.block_name, lowlimit=low_limit, maxwait=self.max_wait)

assert_that(
set_pv_thread.is_alive(),
Expand All @@ -395,9 +384,7 @@ def test_GIVEN_waiting_for_value_above_low_limit_on_block_WHEN_block_below_limit
args=(self.wait_before, self.wait_after, self.pv_name, wrong_value),
)
set_pv_thread.start()
g.waitfor_block(
block=self.block_name, lowlimit=low_limit, maxwait=self.max_wait
)
g.waitfor_block(block=self.block_name, lowlimit=low_limit, maxwait=self.max_wait)

assert_that(
set_pv_thread.is_alive(),
Expand All @@ -417,9 +404,7 @@ def test_GIVEN_waiting_for_value_below_high_limit_on_block_WHEN_block_reaches_li
args=(self.wait_before, self.wait_after, self.pv_name, high_limit),
)
set_pv_thread.start()
g.waitfor_block(
block=self.block_name, highlimit=high_limit, maxwait=self.max_wait
)
g.waitfor_block(block=self.block_name, highlimit=high_limit, maxwait=self.max_wait)

assert_that(
set_pv_thread.is_alive(),
Expand All @@ -437,9 +422,7 @@ def test_GIVEN_waiting_for_value_above_low_limit_on_block_WHEN_block_reaches_lim
args=(self.wait_before, self.wait_after, self.pv_name, low_limit),
)
set_pv_thread.start()
g.waitfor_block(
block=self.block_name, lowlimit=low_limit, maxwait=self.max_wait
)
g.waitfor_block(block=self.block_name, lowlimit=low_limit, maxwait=self.max_wait)

assert_that(
set_pv_thread.is_alive(),
Expand Down Expand Up @@ -606,9 +589,7 @@ def test_GIVEN_invalid_inst_script_from_settings_area_WHEN_calling_script_checke

script_lines_1 = "def sample_changer_scloop(a: int, b: str):\n\tpass\n"

script_lines_2 = [
"from inst import temp_file\n" "temp_file.sample_changer_scloop('a',2)\n"
]
script_lines_2 = ["from inst import temp_file\n" "temp_file.sample_changer_scloop('a',2)\n"]

with open(os.path.join(path_to_inst, temp_file_name), "w") as temp_file:
temp_file.write(script_lines_1)
Expand Down

0 comments on commit 4671535

Please sign in to comment.