| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| Expand Up | @@ -352,6 +352,26 @@ def test_clr_add_reference(): | |
| with pytest.raises(FileNotFoundException): | ||
| AddReference("somethingtotallysilly") | ||
|
|
||
| def test_clr_get_clr_type(): | ||
| """Test clr.GetClrType().""" | ||
| from clr import GetClrType | ||
| import System | ||
| from System import IComparable | ||
| from System import ArgumentException | ||
| assert GetClrType(System.String).FullName == "System.String" | ||
| comparable = GetClrType(IComparable) | ||
| assert comparable.FullName == "System.IComparable" | ||
| assert comparable.IsInterface | ||
| assert GetClrType(int).FullName == "System.Int32" | ||
| assert GetClrType(str).FullName == "System.String" | ||
| assert GetClrType(float).FullName == "System.Double" | ||
| dblarr = System.Array[System.Double] | ||
| assert GetClrType(dblarr).FullName == "System.Double[]" | ||
|
|
||
| with pytest.raises(TypeError): | ||
| GetClrType(1) | ||
|
Comment thread
Copy link
Copy Markdown
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Qualitycan you compare also against types, not instance of types?
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityCan you elaborate, what kind of comparison I should add?
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityGetClrType(int), GetClrType(str)
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityCheck lines 365-367 in the diff :)
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityOh, I see now let's wait for @filmor to approve
Sorry, something went wrong.
All reactions
|
||
| with pytest.raises(TypeError): | ||
| GetClrType("thiswillfail") | ||
|
|
||
| def test_assembly_load_thread_safety(): | ||
| from Python.Test import ModuleTest | ||
| Expand Down | ||
| Back | FazBrowse Home | New Git URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Qualitycan you add the test to invoke the ArgumentException error?
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityDone
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.