Skip to content

Commit

Permalink
add ut for log_to_stdout to true
Browse files Browse the repository at this point in the history
  • Loading branch information
feng-j678 committed Sep 12, 2024
1 parent 3593df9 commit e98112f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/core/tests/Test_MaintenanceWindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,18 @@ def test_RemainingTime_after_duration_complete(self):
self.assertEqual(int(remaining_time), 0)
runtime.stop()

def test_RemainingTime_log_to_stdout_true(self):
argument_composer = ArgumentComposer()
argument_composer.start_time = "2017-02-15T18:15:12.9828835Z"
argument_composer.maximum_duration = "PT1H"
runtime = RuntimeCompositor(argument_composer.get_composed_arguments(), True)

current_time = datetime.datetime.strptime('2017-02-15 18:30:20', "%Y-%m-%d %H:%M:%S")
remaining_time = runtime.maintenance_window.get_remaining_time_in_minutes(current_time, log_to_stdout=True)

self.assertEqual(int(remaining_time), 44)
runtime.stop()

def test_RemainingTime_raise_exception(self):
# Arrange
argument_composer = ArgumentComposer()
Expand Down Expand Up @@ -140,3 +152,4 @@ def test_is_package_install_time_available(self):

if __name__ == '__main__':
unittest.main()

0 comments on commit e98112f

Please sign in to comment.