#!/usr/bin/env python2.7 # Amazon FPGA Hardware Development Kit # # Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Amazon Software License (the "License"). You may not use # this file except in compliance with the License. A copy of the License is # located at # # http://aws.amazon.com/asl/ # # or in the "license" file accompanying this file. This file is distributed on # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or # implied. See the License for the specific language governing permissions and # limitations under the License. ''' Pytest module: Call using ```pytest test_create_afi.py``` See TESTING.md for details. ''' import boto3 import logging import os from os.path import basename, dirname, realpath import pytest import re import sys import traceback import check_src_headers import fileprovider try: import aws_fpga_test_utils from aws_fpga_test_utils.AwsFpgaTestBase import AwsFpgaTestBase import aws_fpga_utils except ImportError as e: traceback.print_tb(sys.exc_info()[2]) print "error: {}\nMake sure to source shared/tests/bin/setup_test_env.sh".format(sys.exc_info()[1]) sys.exit(1) logger = aws_fpga_utils.get_logger(__name__) class TestCheckSrcHeaders(AwsFpgaTestBase): ''' Pytest test class. NOTE: Cannot have an __init__ method. Create AFI from DCP. ''' @classmethod def setup_class(cls): ''' Do any setup required for tests. ''' AwsFpgaTestBase.setup_class(cls, __file__) return def test_check_src_headers(self): # fileprovider.logger.setLevel(logging.DEBUG) # check_project_headers.logger.setLevel(logging.DEBUG) rc = check_src_headers.check_headers('.') assert rc == 0