How to use the vcard.vcard.main function in vcard

To help you get started, we’ve selected a few vcard examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github l0b0 / vcard / tests / test_vcard.py View on Github external
def test_main_fails_when_vcard_validator_fails_on_first_file(self, vcard_validator_mock, parse_arguments_mock):
        parse_arguments_mock.return_value = ARGUMENTS_WITH_PATHS
        vcard_validator_mock.side_effect = [
            mock.Mock(spec=vcard.VcardValidator, result='non-empty'),
            mock.Mock(spec=vcard.VcardValidator, result=None)]
        self.assertEqual(1, vcard.main())
github l0b0 / vcard / tests / test_vcard.py View on Github external
def test_main_fails_when_argument_parsing_fails(self, parse_arguments_mock):
        parse_arguments_mock.side_effect = vcard.UsageError('error')
        self.assertEqual(2, vcard.main())
github l0b0 / vcard / tests / test_vcard.py View on Github external
def test_main_fails_when_vcard_validator_fails(self, vcard_validator_mock, parse_arguments_mock):
        parse_arguments_mock.return_value = ARGUMENTS_WITH_PATH
        vcard_validator_mock.return_value.result = 'non-empty'
        self.assertEqual(1, vcard.main())