Example #1
0
    def test_generateuuids(self):
        '''
        Test if it generate a list of random UUIDs.
        '''
        ret1 = {
            'message': 'No Random.org api key or api version found.',
            'res': False
        }
        self.assertDictEqual(random_org.generateUUIDs(), ret1)

        ret2 = {
            'message': 'Required argument, number is missing.',
            'res': False
        }
        self.assertDictEqual(
            random_org.generateUUIDs(api_key='peW', api_version='1'), ret2)

        ret3 = {
            'message': 'Number of UUIDs must be between 1 and 1000',
            'res': False
        }
        self.assertDictEqual(
            random_org.generateUUIDs(api_key='peW',
                                     api_version='1',
                                     number='5'), ret3)

        ret3 = {'message': u"Parameter 'apiKey' is malformed", 'res': False}
        self.assertDictEqual(
            random_org.generateUUIDs(api_key='peW', api_version='1', number=5),
            ret3)
Example #2
0
    def test_generateuuids(self):
        """
        Test if it generate a list of random UUIDs.
        """
        ret1 = {
            "message": "No Random.org api key or api version found.",
            "res": False
        }
        self.assertDictEqual(random_org.generateUUIDs(), ret1)

        ret2 = {
            "message": "Required argument, number is missing.",
            "res": False
        }
        self.assertDictEqual(
            random_org.generateUUIDs(api_key="peW", api_version="1"), ret2)

        ret3 = {
            "message": "Number of UUIDs must be between 1 and 1000",
            "res": False
        }
        self.assertDictEqual(
            random_org.generateUUIDs(api_key="peW",
                                     api_version="1",
                                     number="5"), ret3)

        ret3 = {"message": "Parameter 'apiKey' is malformed", "res": False}
        self.assertDictEqual(
            random_org.generateUUIDs(api_key="peW", api_version="1", number=5),
            ret3)
Example #3
0
    def test_generateuuids(self):
        '''
        Test if it generate a list of random UUIDs.
        '''
        ret1 = {'message': 'No Random.org api key or api version found.',
                'res': False}
        self.assertDictEqual(random_org.generateUUIDs(), ret1)

        ret2 = {'message': 'Required argument, number is missing.',
                'res': False}
        self.assertDictEqual(random_org.generateUUIDs(api_key='peW',
                                                      api_version='1'), ret2)

        ret3 = {'message': 'Number of UUIDs must be between 1 and 1000',
                'res': False}
        self.assertDictEqual(random_org.generateUUIDs(api_key='peW',
                                                      api_version='1',
                                                      number='5'), ret3)

        ret3 = {'message': u"Parameter 'apiKey' is malformed",
                'res': False}
        self.assertDictEqual(random_org.generateUUIDs(api_key='peW',
                                                      api_version='1',
                                                      number=5), ret3)