2525from c2pa .c2pa import Stream
2626
2727PROJECT_PATH = os .getcwd ()
28+ FIXTURES_FOLDER = os .path .join (os .path .dirname (__file__ ), "fixtures" )
29+ DEFAULT_TEST_FILE = os .path .join (FIXTURES_FOLDER , "C.jpg" )
30+ INGREDIENT_TEST_FILE = os .path .join (FIXTURES_FOLDER , "A.jpg" )
31+ ALTERNATIVE_INGREDIENT_TEST_FILE = os .path .join (FIXTURES_FOLDER , "cloud.jpg" )
32+ OTHER_ALTERNATIVE_INGREDIENT_TEST_FILE = os .path .join (FIXTURES_FOLDER , "A_thumbnail.jpg" )
2833
2934# Note: Despite being threaded, some of the tests will take time to run,
3035# as they may try to push for thread contention, or simply just have a lot
3439class TestReaderWithThreads (unittest .TestCase ):
3540 def setUp (self ):
3641 # Use the fixtures_dir fixture to set up paths
37- self .data_dir = os . path . join ( os . path . dirname ( __file__ ), "fixtures" )
38- self .testPath = os . path . join ( self . data_dir , "C.jpg" )
42+ self .data_dir = FIXTURES_FOLDER
43+ self .testPath = DEFAULT_TEST_FILE
3944
4045 def test_stream_read (self ):
4146 def read_metadata ():
@@ -163,7 +168,7 @@ def process_file(filename):
163168class TestBuilderWithThreads (unittest .TestCase ):
164169 def setUp (self ):
165170 # Use the fixtures_dir fixture to set up paths
166- self .data_dir = os . path . join ( os . path . dirname ( __file__ ), "fixtures" )
171+ self .data_dir = FIXTURES_FOLDER
167172 with open (os .path .join (self .data_dir , "es256_certs.pem" ), "rb" ) as cert_file :
168173 self .certs = cert_file .read ()
169174 with open (os .path .join (self .data_dir , "es256_private.key" ), "rb" ) as key_file :
@@ -178,10 +183,10 @@ def setUp(self):
178183 )
179184 self .signer = Signer .from_info (self .signer_info )
180185
181- self .testPath = os . path . join ( self . data_dir , "C.jpg" )
182- self .testPath2 = os . path . join ( self . data_dir , "A.jpg" )
183- self .testPath3 = os . path . join ( self . data_dir , "A_thumbnail.jpg" )
184- self .testPath4 = os . path . join ( self . data_dir , "cloud.jpg" )
186+ self .testPath = DEFAULT_TEST_FILE
187+ self .testPath2 = INGREDIENT_TEST_FILE
188+ self .testPath3 = OTHER_ALTERNATIVE_INGREDIENT_TEST_FILE
189+ self .testPath4 = ALTERNATIVE_INGREDIENT_TEST_FILE
185190
186191 # For that test manifest, we use a placeholder assertion with content
187192 # varying depending on thread/manifest, to check for data scrambling.
0 commit comments