File size: 515 Bytes
9f2df60
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from datetime import datetime
import pytest

from src.scraping.utils import *

pytestmark = pytest.mark.network


class TestScrapingUtils:

    def test_url_fetching(self):
        url = 'https://embax.ch/'
        
        fetch_result = fetch_url(url)
        assert fetch_result
        assert len(fetch_result['text']) > 100
        assert fetch_result['final_url'] == url
        assert isinstance(fetch_result['last_modified'], datetime) 


if __name__ == "__main__":
    pytest.main([__file__, '-v', '-s'])