コード例 #1
0
ファイル: test_config.py プロジェクト: jhonsnow456/bodhi
    def test_with_changeme(self):
        """Ensure that CHANGEME raises a ValueError."""
        with pytest.raises(ValueError) as exc:
            config._validate_secret('CHANGEME')

        assert str(exc.value
                   ) == 'This setting must be changed from its default value.'
コード例 #2
0
    def test_with_changeme(self):
        """Ensure that CHANGEME raises a ValueError."""
        with self.assertRaises(ValueError) as exc:
            config._validate_secret('CHANGEME')

        self.assertEqual(
            str(exc.exception),
            'This setting must be changed from its default value.')
コード例 #3
0
ファイル: test_config.py プロジェクト: sitedata/bodhi
    def test_with_secret(self):
        """Ensure that a secret gets changed to a unicode."""
        result = config._validate_secret('secret')

        assert result == 'secret'
        assert isinstance(result, str)
コード例 #4
0
    def test_with_secret(self):
        """Ensure that a secret gets changed to a unicode."""
        result = config._validate_secret('secret')

        self.assertEqual(result, u'secret')
        self.assertTrue(isinstance(result, six.text_type))