-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Edited tests and github-actions file
- Loading branch information
1 parent
2115dd7
commit 67a6342
Showing
6 changed files
with
83 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: pkg | ||
|
||
on: | ||
push: | ||
branches: [ dev-cli ] | ||
pull_request: | ||
branches: [ dev-cli ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.10 | ||
- name: Install library | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install . | ||
- name: Test with unittest | ||
run: python -m unittest discover |
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 @@ | ||
|
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 @@ | ||
import unittest | ||
|
||
import pandas as pd | ||
|
||
from pavlovia_survey_utils.api import file_utils | ||
|
||
|
||
class TestFileUtils(unittest.TestCase): | ||
|
||
def test_find_image_columns(self): | ||
df = pd.DataFrame({ | ||
'image1': ['data:image/png;base64,abc', 'data:image/png;base64,def'], | ||
'image2': ['data:image/png;base64,ghi', 'data:image/png;base64,jkl'], | ||
'text': ['abc', 'def'] | ||
}) | ||
|
||
self.assertEqual(file_utils.find_image_columns(df), ['image1', 'image2']) | ||
|
||
self.assertEqual(file_utils.find_image_columns( | ||
df.drop(columns=['image1'])), ['image2']) | ||
|
||
self.assertEqual(file_utils.find_image_columns( | ||
df[['text']]), []) # No image columns | ||
|
||
def test_read_base64_img_str(self): | ||
pass | ||
|
||
def test_save_image_columns(self): | ||
pass | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |
Empty file.