Skip to content
New issue

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

Added VS projects for unit testing. #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,9 @@
/py3/dist
/py3/SciServer.egg-info
/py3/.idea
/Examples/.ipynb_checkpoints/
/Examples/.ipynb_checkpoints/

# Visual Studio Related
.vs
__pycache__
*.user
24 changes: 24 additions & 0 deletions SciScript-Python.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25123.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{888888A0-9F3D-457C-B088-3A5042F75D52}") = "py2", "py2\py2.pyproj", "{1909A0AF-AFBF-4C19-B1A0-FD3C22469C09}"
EndProject
Project("{888888A0-9F3D-457C-B088-3A5042F75D52}") = "py3", "py3\py3.pyproj", "{BA762BB2-12BC-45BF-876B-2D77D1568FFA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1909A0AF-AFBF-4C19-B1A0-FD3C22469C09}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1909A0AF-AFBF-4C19-B1A0-FD3C22469C09}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BA762BB2-12BC-45BF-876B-2D77D1568FFA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BA762BB2-12BC-45BF-876B-2D77D1568FFA}.Release|Any CPU.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
40 changes: 40 additions & 0 deletions py2/py2.pyproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{1909a0af-afbf-4c19-b1a0-fd3c22469c09}</ProjectGuid>
<ProjectHome />
<StartupFile>setup.py</StartupFile>
<SearchPath />
<WorkingDirectory>.</WorkingDirectory>
<OutputPath>.</OutputPath>
<ProjectTypeGuids>{888888a0-9f3d-457c-b088-3a5042f75d52}</ProjectTypeGuids>
<LaunchProvider>Standard Python launcher</LaunchProvider>
<InterpreterId />
<InterpreterVersion />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug'" />
<PropertyGroup Condition="'$(Configuration)' == 'Release'" />
<PropertyGroup>
<VisualStudioVersion Condition=" '$(VisualStudioVersion)' == '' ">10.0</VisualStudioVersion>
<PtvsTargetsFile>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Python Tools\Microsoft.PythonTools.targets</PtvsTargetsFile>
</PropertyGroup>
<ItemGroup>
<Compile Include="SciServer\Authentication.py" />
<Compile Include="SciServer\CasJobs.py" />
<Compile Include="SciServer\Config.py" />
<Compile Include="SciServer\IntegrationTest.py" />
<Compile Include="SciServer\LoginPortal.py" />
<Compile Include="SciServer\SciDrive.py" />
<Compile Include="SciServer\SkyQuery.py" />
<Compile Include="SciServer\SkyServer.py" />
<Compile Include="SciServer\__init__.py" />
<Compile Include="setup.py" />
</ItemGroup>
<ItemGroup>
<Folder Include="SciServer" />
</ItemGroup>
<Import Project="$(PtvsTargetsFile)" Condition="Exists($(PtvsTargetsFile))" />
<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" Condition="!Exists($(PtvsTargetsFile))" />
</Project>
13 changes: 7 additions & 6 deletions Tests/UnitTests.py → py3/Tests/UnitTests.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/python
from SciServer import Authentication, LoginPortal, Config, CasJobs, SkyServer, SkyQuery, SciDrive
import unittest2 as unittest
#import unittest2 as unittest
import unittest
import os;
import pandas;
import sys;
Expand All @@ -10,9 +11,9 @@
import skimage

# Define login Name and password before running the tests:
Authentication_loginName = '***';
Authentication_loginPassword = '***'

Authentication_loginName = '****';
Authentication_loginPassword = '****'
SkyQuery_UserTablePrefix = 'webuser'

#skyserver
SkyServer_TestQuery = "select top 1 specobjid, ra, dec from specobj order by specobjid"
Expand Down Expand Up @@ -376,9 +377,9 @@ def test_SkyQuery_uploadTable_getTable_getTableInfo_listTableColumns_dropTable(s
table = SkyQuery.getTable(tableName=SkyQuery_TestTableName, datasetName="MyDB", top=10)
self.assertEqual(SkyQuery_TestTableCSVdownloaded, table.to_csv(index=False));

info = SkyQuery.getTableInfo(tableName="webuser." + SkyQuery_TestTableName, datasetName="MyDB")
info = SkyQuery.getTableInfo(tableName=SkyQuery_UserTablePrefix + '.' + SkyQuery_TestTableName, datasetName="MyDB")

columns = SkyQuery.listTableColumns(tableName="webuser." + SkyQuery_TestTableName, datasetName="MyDB")
columns = SkyQuery.listTableColumns(tableName=SkyQuery_UserTablePrefix + '.' + SkyQuery_TestTableName, datasetName="MyDB")

result = SkyQuery.dropTable(tableName=SkyQuery_TestTableName, datasetName="MyDB");
self.assertEqual(result, True)
Expand Down
41 changes: 41 additions & 0 deletions py3/py3.pyproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{ba762bb2-12bc-45bf-876b-2d77d1568ffa}</ProjectGuid>
<ProjectHome />
<StartupFile>setup.py</StartupFile>
<SearchPath />
<WorkingDirectory>.</WorkingDirectory>
<OutputPath>.</OutputPath>
<ProjectTypeGuids>{888888a0-9f3d-457c-b088-3a5042f75d52}</ProjectTypeGuids>
<LaunchProvider>Standard Python launcher</LaunchProvider>
<InterpreterId />
<InterpreterVersion />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug'" />
<PropertyGroup Condition="'$(Configuration)' == 'Release'" />
<PropertyGroup>
<VisualStudioVersion Condition=" '$(VisualStudioVersion)' == '' ">10.0</VisualStudioVersion>
<PtvsTargetsFile>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Python Tools\Microsoft.PythonTools.targets</PtvsTargetsFile>
</PropertyGroup>
<ItemGroup>
<Compile Include="SciServer\Authentication.py" />
<Compile Include="SciServer\CasJobs.py" />
<Compile Include="SciServer\Config.py" />
<Compile Include="SciServer\LoginPortal.py" />
<Compile Include="SciServer\SciDrive.py" />
<Compile Include="SciServer\SkyQuery.py" />
<Compile Include="SciServer\SkyServer.py" />
<Compile Include="SciServer\__init__.py" />
<Compile Include="setup.py" />
<Compile Include="Tests\UnitTests.py" />
</ItemGroup>
<ItemGroup>
<Folder Include="SciServer" />
<Folder Include="Tests\" />
</ItemGroup>
<Import Project="$(PtvsTargetsFile)" Condition="Exists($(PtvsTargetsFile))" />
<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" Condition="!Exists($(PtvsTargetsFile))" />
</Project>