From 42cf6365a946167a0bda18cce3ad02d20428e157 Mon Sep 17 00:00:00 2001 From: Gabriel Moura Date: Sat, 31 Oct 2020 22:46:43 -0300 Subject: [PATCH] add list_functions_test --- tests/test_functions.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 tests/test_functions.py diff --git a/tests/test_functions.py b/tests/test_functions.py new file mode 100644 index 0000000..a403116 --- /dev/null +++ b/tests/test_functions.py @@ -0,0 +1,22 @@ +"""Test functions.py""" +import unittest +from unittest.mock import MagicMock + +from gcloud_utils import functions + +PROJECT = "teste1" +ZONE = "teste2" + + +class TestFunctions(unittest.TestCase): + def setUp(self): + self.functions = functions.Functions(PROJECT, ZONE) + + def test_list_functions(self): + self.functions = MagicMock() + self.functions__execute_request = MagicMock() + + self.functions.list_functions() + + self.functions.assert_called_once() + self.functions__execute_request.asser_called_once()