-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
108 additions
and
7 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
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,33 @@ | ||
const rhino3dm = require('rhino3dm') | ||
|
||
let rhino | ||
beforeEach( async() => { | ||
rhino = await rhino3dm() | ||
}) | ||
//TODO | ||
// Skipping for now. | ||
test('DeleteDimStyle', async () => { | ||
|
||
const file3dm = new rhino.File3dm() | ||
file3dm.applicationName = 'rhino3dm.js' | ||
file3dm.applicationDetails = 'rhino3dm-tests-dimStyleTable-deleteDimStyle' | ||
file3dm.applicationUrl = 'https://rhino3d.com' | ||
|
||
const ds1 = new rhino.DimensionStyle() | ||
const ds2 = new rhino.DimensionStyle() | ||
|
||
// .bitmaps().add() is void | ||
model.dimstyles().add(ds1) | ||
model.dimstyles().add(ds2) | ||
|
||
const qtyDimStyles1 = model.dimstyles().count | ||
|
||
const id1 = model.dimstyles().get(0).id | ||
|
||
model.dimstyles().delete(id1) | ||
|
||
const qtyDimStyles2 = model.dimstyles().count | ||
|
||
expect(qtyDimStyles1 === 2 && qtyDimStyles2 === 1).toBe(true) | ||
|
||
}) |
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,33 @@ | ||
import rhino3dm | ||
import unittest | ||
|
||
#objective: to test creating file with bitmaps | ||
class TestFile3dmBitmapTable(unittest.TestCase): | ||
|
||
def test_deleteDimStyle(self): | ||
file3dm = rhino3dm.File3dm() | ||
file3dm.ApplicationName = 'python' | ||
file3dm.ApplicationDetails = 'rhino3dm-tests-deleteDimStyle' | ||
file3dm.ApplicationUrl = 'https://rhino3d.com' | ||
|
||
#create bitmaps | ||
bm1 = rhino3dm.DimensionStyle() | ||
bm2 = rhino3dm.DimensionStyle() | ||
|
||
file3dm.DimStyles.Add(bm1) | ||
file3dm.DimStyles.Add(bm2) | ||
|
||
qtyDimStyles1 = len(file3dm.DimStyles) | ||
|
||
id1 = file3dm.DimStyles[0].Id | ||
|
||
file3dm.DimStyles.Delete(id1) | ||
|
||
qtyDimStyles2 = len(file3dm.DimStyles) | ||
|
||
self.assertTrue(qtyDimStyles1 == 2 and qtyDimStyles2 == 1) | ||
|
||
if __name__ == '__main__': | ||
print("running tests") | ||
unittest.main() | ||
print("tests complete") |