def test_execute_client_strategy_server_update_file(self, mock_1, mock_2): obj_to_iterate: list = [ default_code.ResultObj(Actions.SERVER_UPDATE_FILE).result ] logger = default_code.FakeLogger() self.client_strategy.execute(obj_to_iterate, logger) mock_1.assert_called_once() mock_2.assert_called_once()
def test_execute_client_strategy_common(self, mock_1): obj_to_iterate: list = [ default_code.ResultObj(Actions.CLIENT_UPDATE_FILE).result, default_code.ResultObj(Actions.CLIENT_NEW_FOLDER).result, default_code.ResultObj(Actions.CLIENT_NEW_FILE).result, default_code.ResultObj(Actions.SERVER_NEW_FOLDER).result, default_code.ResultObj(Actions.SERVER_NEW_FILE).result ] logger = default_code.FakeLogger() self.client_strategy.execute(obj_to_iterate, logger) self.assertEqual(mock_1.call_count, 5)
def test_common_strategy_client_new_file_id_not_exists(self, m1, m2): node_raw = { "action": Actions.CLIENT_NEW_FILE, "node": TreeNode(Node("a", "ciao.txt", Type.File, 100, 200, "a/ciao.txt")) } logger = default_code.FakeLogger() strategy.common_strategy(node_raw, logger) m1.assert_not_called() m2.assert_called_once()
def test_execute_manual_strategy_server_update_file_none( self, mock_1, mock_2, mock_3): obj_to_iterate: list = [ default_code.ResultObj(Actions.SERVER_UPDATE_FILE, 0, "name.ciao.we").result ] logger = default_code.FakeLogger() self.manual_strategy.execute(obj_to_iterate, logger) mock_1.assert_called_once() mock_2.assert_called_once() mock_3.assert_called_once()