Created
July 31, 2012 21:25
-
-
Save dicato/3220727 to your computer and use it in GitHub Desktop.
Illustrate exception fix for Intellect
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
from intellect.Intellect import Intellect | |
if __name__ == '__main__': | |
test_intellect = Intellect() | |
# This should throw a generic exception | |
try: | |
test_intellect.learn('/path/to/bad/file.policy') | |
except Exception: | |
print "Caught a generic exception" | |
# This should work | |
test_intellect.learn(""" | |
rule always_fire: | |
then: | |
print("hello world!!!!") | |
""") | |
# This should throw a generic exception | |
try: | |
test_intellect.learn(""" | |
This is a bad policy! | |
""") | |
except Exception: | |
print "Caught a generic exception" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment