def test_missing_placeholder(self, mock_fs):
        content = 'content'
        mock_fs.read_file.side_effect = iter([self.placeholders, content])

        actual = placeholder.validate_email(self.email)

        self.assertFalse(actual)
    def test_extra_placeholder(self, mock_fs):
        placeholders = json.dumps({'test_name': {}})
        mock_fs.read_file.side_effect = iter([placeholders, self.content])

        actual = placeholder.validate_email(self.email)

        self.assertFalse(actual)
Exemplo n.º 3
0
    def test_extra_placeholder(self, mock_fs):
        placeholders = json.dumps({'test_name': {}})
        mock_fs.read_file.side_effect = iter([placeholders, self.content])

        actual = placeholder.validate_email(self.email)

        self.assertFalse(actual)
Exemplo n.º 4
0
    def test_missing_placeholder(self, mock_fs):
        content = 'content'
        mock_fs.read_file.side_effect = iter([self.placeholders, content])

        actual = placeholder.validate_email(self.email)

        self.assertFalse(actual)
Exemplo n.º 5
0
    def test_happy_path(self, mock_reader, mock_fs):
        mock_fs.read_file.side_effect = iter([self.placeholders])
        mock_reader.read.return_value = ("", {"segment": self.content}, "")

        actual = placeholder.validate_email(self.settings, self.email)

        self.assertTrue(actual)
Exemplo n.º 6
0
    def test_extra_placeholder(self, mock_reader, mock_fs):
        placeholders = json.dumps({"test_name": {}})
        mock_fs.read_file.side_effect = iter([placeholders])
        mock_reader.read.return_value = ("", {"segment": self.content}, "")

        actual = placeholder.validate_email(self.settings, self.email)

        self.assertFalse(actual)
Exemplo n.º 7
0
    def test_missing_placeholder(self, mock_reader, mock_fs):
        content = "content"
        mock_fs.read_file.side_effect = iter([self.placeholders])
        mock_reader.read.return_value = ("", {"segment": content}, "")

        actual = placeholder.validate_email(self.settings, self.email)

        self.assertFalse(actual)
    def test_happy_path(self, mock_fs):
        mock_fs.read_file.side_effect = iter([self.placeholders, self.content])

        actual = placeholder.validate_email(self.email)

        self.assertTrue(actual)
Exemplo n.º 9
0
    def test_happy_path(self, mock_fs):
        mock_fs.read_file.side_effect = iter([self.placeholders, self.content])

        actual = placeholder.validate_email(self.email)

        self.assertTrue(actual)