Skip to content

Commit

Permalink
[SAI-PTF]add conditional import for unit test (opencomputeproject#1656)
Browse files Browse the repository at this point in the history
* [SAI-PTF]add conditional import for unit test

Signed-off-by: richardyu-ms <richard.yu@microsoft.com>

* [SAI-PTF]add conditional import for unit test

Signed-off-by: richardyu-ms <richard.yu@microsoft.com>

Signed-off-by: richardyu-ms <richard.yu@microsoft.com>
  • Loading branch information
richardyu-ms committed Nov 20, 2022
1 parent af34a65 commit e0ec860
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions ptf/utest/TemplateTest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
from BasicTest import BasicMockedTest
from meta.sai_adapter import *
# Try to import from local build folder
# If cannot import then try to import from global folder
try:
from meta.sai_adapter import *
except ImportError:
from sai_thrift.sai_adapter import *
from MockClient import MockSuccessClient
import unittest

Expand Down Expand Up @@ -47,7 +52,3 @@ def check_file_contains(self, file, content):
if content in line:
return True
return False


if __name__ == '__main__':
unittest.main()

0 comments on commit e0ec860

Please sign in to comment.