Beispiel #1
0
    def test_generateblobs(self):
        '''
        Test if it list all Slack users.
        '''
        ret1 = {
            'message': 'No Random.org api key or api version found.',
            'res': False
        }
        self.assertDictEqual(random_org.generateBlobs(), ret1)

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

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

        ret4 = {
            'message': 'Number of blobs must be between 1 and 100',
            'res': False
        }
        self.assertDictEqual(
            random_org.generateBlobs(api_key='peW',
                                     api_version='1',
                                     number=5,
                                     size=1), ret4)

        ret5 = {
            'message': 'Format must be either base64 or hex.',
            'res': False
        }
        self.assertDictEqual(
            random_org.generateBlobs(api_key='peW',
                                     api_version='1',
                                     number=5,
                                     size=8,
                                     format='oct'), ret5)

        ret6 = {'message': u"Parameter 'apiKey' is malformed", 'res': False}
        self.assertDictEqual(
            random_org.generateBlobs(api_key='peW',
                                     api_version='1',
                                     number=5,
                                     size=8,
                                     format='hex'), ret6)
Beispiel #2
0
    def test_generateblobs(self):
        """
        Test if it list all Slack users.
        """
        ret1 = {"message": "No Random.org api key or api version found.", "res": False}
        self.assertDictEqual(random_org.generateBlobs(), ret1)

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

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

        ret4 = {"message": "Number of blobs must be between 1 and 100", "res": False}
        self.assertDictEqual(
            random_org.generateBlobs(api_key="peW", api_version="1", number=5, size=1),
            ret4,
        )

        ret5 = {"message": "Format must be either base64 or hex.", "res": False}
        self.assertDictEqual(
            random_org.generateBlobs(
                api_key="peW", api_version="1", number=5, size=8, format="oct"
            ),
            ret5,
        )

        ret6 = {"message": "Parameter 'apiKey' is malformed", "res": False}
        self.assertDictEqual(
            random_org.generateBlobs(
                api_key="peW", api_version="1", number=5, size=8, format="hex"
            ),
            ret6,
        )
Beispiel #3
0
    def test_generateblobs(self):
        '''
        Test if it list all Slack users.
        '''
        ret1 = {'message': 'No Random.org api key or api version found.',
                'res': False}
        self.assertDictEqual(random_org.generateBlobs(), ret1)

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

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

        ret4 = {'message': 'Number of blobs must be between 1 and 100',
                'res': False}
        self.assertDictEqual(random_org.generateBlobs(api_key='peW',
                                                      api_version='1', number=5,
                                                      size=1), ret4)

        ret5 = {'message': 'Format must be either base64 or hex.', 'res': False}
        self.assertDictEqual(random_org.generateBlobs(api_key='peW',
                                                      api_version='1', number=5,
                                                      size=8, format='oct'),
                             ret5)

        ret6 = {'message': u"Parameter 'apiKey' is malformed", 'res': False}
        self.assertDictEqual(random_org.generateBlobs(api_key='peW',
                                                      api_version='1',
                                                      number=5, size=8,
                                                      format='hex'), ret6)