-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added overload for ifcString to take a text values started unit tests
- Loading branch information
Showing
7 changed files
with
123 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import os | ||
import unittest | ||
import math | ||
import testcfg | ||
|
||
import PyRx as Rx | ||
import PyGe as Ge | ||
import PyGi as Gi | ||
import PyDb as Db | ||
import PyAp as Ap | ||
import PyEd as Ed | ||
import PyBrxBim as Bm | ||
|
||
host = Ap.Application.hostAPI() | ||
|
||
|
||
class TestBCadBim(unittest.TestCase): | ||
def __init__(self, *args, **kwargs): | ||
super(TestBCadBim, self).__init__(*args, **kwargs) | ||
|
||
def __del__(self): | ||
pass | ||
|
||
def test_IfcVariant(self): | ||
v = Bm.IfcVariant() | ||
|
||
v.setBool(True) | ||
self.assertEqual(v.type(), Bm.IfcValueType.eBool) | ||
self.assertEqual(v.getBool(), True) | ||
|
||
v.setInt(42) | ||
self.assertEqual(v.type(), Bm.IfcValueType.eInt) | ||
self.assertEqual(v.getInt(), 42) | ||
|
||
v.setUInt(44) | ||
self.assertEqual(v.type(), Bm.IfcValueType.eUInt) | ||
self.assertEqual(v.getUInt(), 44) | ||
|
||
v.setReal(3.14) | ||
self.assertEqual(v.type(), Bm.IfcValueType.eReal) | ||
self.assertEqual(v.getReal(), 3.14) | ||
|
||
vs = Bm.IfcString("OMG YAY") | ||
v.setString(vs) | ||
self.assertEqual(v.type(), Bm.IfcValueType.eString) | ||
self.assertEqual(v.getString().c_str(), "OMG YAY") | ||
|
||
|
||
def pybcbimtest(): | ||
try: | ||
suite = unittest.TestLoader().loadTestsFromTestCase(TestBCadBim) | ||
if testcfg.logToFile: | ||
with open(testcfg.logFileName, "a") as f: | ||
f.write("\n{:*^60s}\n".format("TestBricsCADBim")) | ||
runner = unittest.TextTestRunner(f, verbosity=testcfg.testVerbosity) | ||
runner.run(suite) | ||
else: | ||
print("TestBricsCADBim") | ||
print(unittest.TextTestRunner(verbosity=testcfg.testVerbosity).run(suite)) | ||
except Exception as err: | ||
print(err) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters