set timeout for reading from ical url
This commit is contained in:
		
							
								
								
									
										4
									
								
								.github/workflows/tests.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								.github/workflows/tests.yml
									
									
									
									
										vendored
									
									
								
							| @@ -4,6 +4,7 @@ on: [push] | |||||||
|  |  | ||||||
| jobs: | jobs: | ||||||
|   build: |   build: | ||||||
|  |  | ||||||
|     runs-on: ubuntu-latest |     runs-on: ubuntu-latest | ||||||
|  |  | ||||||
|     steps: |     steps: | ||||||
| @@ -13,7 +14,6 @@ jobs: | |||||||
|       with: |       with: | ||||||
|         python-version: 3.9 |         python-version: 3.9 | ||||||
|  |  | ||||||
|   download and install: |  | ||||||
|     - name: Clone repo |     - name: Clone repo | ||||||
|       run: | |       run: | | ||||||
|         git clone --branch feature/venv --single-branch https://github.com/aceisace/Inkycal |         git clone --branch feature/venv --single-branch https://github.com/aceisace/Inkycal | ||||||
| @@ -27,10 +27,10 @@ jobs: | |||||||
|  |  | ||||||
|     - name: Install dependencies |     - name: Install dependencies | ||||||
|       run: | |       run: | | ||||||
|  |         echo "$PWD" | ||||||
|         pip install wheel |         pip install wheel | ||||||
|         pip install -e ./ |         pip install -e ./ | ||||||
|  |  | ||||||
|   unit testing: |  | ||||||
|     - name: Setup test environment and run tests  |     - name: Setup test environment and run tests  | ||||||
|       run: | |       run: | | ||||||
|         cd inkycal/tests |         cd inkycal/tests | ||||||
|   | |||||||
| @@ -40,7 +40,7 @@ class ical_parser_test(unittest.TestCase): | |||||||
|  |  | ||||||
|     def test_laod_from_file(self): |     def test_laod_from_file(self): | ||||||
|         print('testing loading from file...', end="") |         print('testing loading from file...', end="") | ||||||
|         dummy = str(urlopen(test_ical).read().decode()) |         dummy = str(urlopen(test_ical, timeout=10).read().decode()) | ||||||
|         with open('dummy.ical', mode="w", encoding="utf-8") as file: |         with open('dummy.ical', mode="w", encoding="utf-8") as file: | ||||||
|             file.write(dummy) |             file.write(dummy) | ||||||
|         ical.load_from_file('dummy.ical') |         ical.load_from_file('dummy.ical') | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user