예제 #1
0
 def test_validate_dirname_doesnotexist(self):
     """ Assert function raises error when dirname does not exist"""
     # Define path that does not exist
     dirname = '/pathdoesnotexist'
     # Assert SystemExit raised
     with self.assertRaises(SystemExit) as err:
         upload_bids.validate_dirname(dirname)
예제 #2
0
    def test_validate_dirname_file(self):
        """ Assert function raises error when file used as an input"""
        # Get filename of the test script
        filename = os.path.abspath(__file__)

        # Assert SystemExit raised
        with self.assertRaises(SystemExit) as err:
            upload_bids.validate_dirname(filename)
예제 #3
0
 def test_validate_dirname_valid(self):
     """ Assert function does not raise error when valid dirname an input"""
     # Get directory the test script is in...
     dirname = os.path.dirname(os.path.abspath(__file__))
     # Call function
     upload_bids.validate_dirname(dirname)