Zontex / python-red-alert

Israeli Pikud Haoref missile detection API
MIT License
45 stars 7 forks source link

How to run a test server #4

Open yakirdayan opened 1 year ago

yakirdayan commented 1 year ago

When I multiply the Main file and put alert link to perform "tests" I get the following error

Traceback (Most Recent Call Last): File "C: \ User's \ User \ Desktop \ Python-Red-Mold-Master \ Src \ Main1.py", LINE 151, in Main () File "C: \ Use \ User \ Desktop \ Python-Red-Hert-Master \ Src \ Main1.py", LINE 119, in Main Red_alerts = Alert.get_red_Alerts () File "C: \ Use \ User \ Desktop \ Python-Rred-Bald-Master \ Src \ Main1.py", LINE 93, in Get_RED_ALRTS Alerts = R.Content.decode ("UTF-8"). Replace ("\ n", "). Replace (" \ r ",") Unicodedecodeperror: 'Utf-8

The format of the data I introduced in the JSON file is the data that appears in the Readme.D file. You can explain why I get this error only when I replace the Home Front Command's link to the link with which I do "tests"

Betzalel-Maor commented 1 year ago

I'm trying to make a test server too. Have you figured it out yet?

I'm using a test JSON file and linking the HOST to the file, but I think i'm doing something wrong, since it's not working.

This is the JSON file i'm using:


  "data": [
    {
      "alertDate": "2023-05-09T16:22:00",
      "alertType": "Red",
      "data": {
        "location": "Test Location"
      },
      "alertID": "12345"
    }
  ]
}```
Zontex commented 5 months ago

Assigned to myself to create a working test