| 1 | # unit tests for ImageCache |
| 2 | |
| 3 | def ic_create_test(): |
| 4 | print "Starting ImageCache.create() tests..." |
| 5 | print "Every other test requires these tests to pass." |
| 6 | # test 1 |
| 7 | try: |
| 8 | cache = None |
| 9 | cache = oiio.ImageCache.create() |
| 10 | if cache != None: |
| 11 | print "Test 1 passed" |
| 12 | else: |
| 13 | print "Test 1 failed" |
| 14 | except: |
| 15 | print "Test 1 failed" |
| 16 | |
| 17 | # test 2 |
| 18 | try: |
| 19 | cache = None |
| 20 | cache = oiio.ImageCache.create(False) |
| 21 | if cache != None: |
| 22 | print "Test 2 passed" |
| 23 | else: |
| 24 | print "Test 2 failed" |
| 25 | except: |
| 26 | print "Test 2 failed" |
| 27 | # test 3 |
| 28 | try: |
| 29 | cache = None |
| 30 | cache = oiio.ImageCache.create(True) |
| 31 | if cache != None: |
| 32 | print "Test 3 passed" |
| 33 | else: |
| 34 | print "Test 3 failed" |
| 35 | except: |
| 36 | print "Test 3 failed" |
| 37 | # test 4 |
| 38 | try: |
| 39 | cache = None |
| 40 | cache = oiio.ImageCache.create("not a proper argument") |
| 41 | if cache != None: |
| 42 | print "Test 4 passed" |
| 43 | else: |
| 44 | print "Test 4 failed" |
| 45 | except: |
| 46 | print "Test 4 failed" |
| 47 | |
| 48 | print |
| 49 | |
| 50 | |
| 51 | def ic_clear_test(): |