Last active
August 29, 2015 13:56
-
-
Save pvandervelde/8995251 to your computer and use it in GitHub Desktop.
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
import clr | |
clr.AddReference("Apollo.Core.Scripting") | |
import sys | |
import Apollo.Core.Scripting | |
# Verify that we don't have an active project | |
hasactiveproject = projects.HasActiveProject() | |
if hasactiveproject: | |
print 'Fail: Active project already exists' | |
sys.exit(1) | |
# Create a project | |
try: | |
projects.NewProject() | |
except Exception, e: | |
print 'Fail: Could not create new project' | |
sys.exit(1) | |
# Verify that the project was created | |
newproject = projects.ActiveProject() | |
if newproject is None: | |
print 'Fail: No new project was created' | |
sys.exit(1) | |
else: | |
print 'Pass: New project created successfully' | |
# verify that we can set the name | |
newname = 'project_newname' | |
newproject.Name = newname | |
if newproject.Name != newname: | |
print 'Fail: Project name was not updated' | |
sys.exit(1) | |
else: | |
print 'Pass: Project name updated successfully' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment