コード例 #1
0
ファイル: test_fec_services.py プロジェクト: yifanjia/cs186
    def test_get_all_transaction_amounts(self):
        """Verify the first dict has the right keys."""
        results = fec.get_all_transaction_amounts()
        result = results[0]

        # Inspect first result for proper keys
        self.assertIn('state', result)
        self.assertIn('amount', result)
コード例 #2
0
ファイル: test_fec_services.py プロジェクト: yaxinn/introdb
    def test_get_all_transaction_amounts(self):
        """Verify the first dict has the right keys."""
        results = fec.get_all_transaction_amounts()
        result = results[0]

        # Inspect first result for proper keys
        self.assertIn('state', result)
        self.assertIn('amount', result)
コード例 #3
0
ファイル: fec.py プロジェクト: AngleCourse/course_sp15
def all_transaction_amounts():
    """Return a JSON response containing all the postitive contributions."""
    return Response(
        ujson.dumps({'txn_amounts': get_all_transaction_amounts()}),
        mimetype='application/json'
    )
コード例 #4
0
ファイル: test_fec_services.py プロジェクト: yifanjia/cs186
    def test_get_all_transaction_amounts_all_positive(self):
        """Verify all records returned are greater than 0."""
        results = fec.get_all_transaction_amounts()

        for result in results:
            self.assertLess(0, result['amount'])
コード例 #5
0
ファイル: test_fec_services.py プロジェクト: yaxinn/introdb
    def test_get_all_transaction_amounts_all_positive(self):
        """Verify all records returned are greater than 0."""
        results = fec.get_all_transaction_amounts()

        for result in results:
            self.assertLess(0, result['amount'])
コード例 #6
0
def all_transaction_amounts():
    """Return a JSON response containing all the postitive contributions."""
    return Response(ujson.dumps({'txn_amounts':
                                 get_all_transaction_amounts()}),
                    mimetype='application/json')