Skip to content

Commit

Permalink
Add base for test.
Browse files Browse the repository at this point in the history
  • Loading branch information
viferga committed Dec 13, 2024
1 parent 23a7c73 commit fb79963
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/spacex/launchpads.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from metacall import metacall_load_from_file, metacall_await
import json

# TODO: This test won't work because python port has no metacall_await
# implemented yet, this is a task to be done in metacall/core

metacall_load_from_file('node', ['./spacex.js'])
response = metacall_await('getSpaceXData')
print(json.dumps(response, indent=4))
1 change: 1 addition & 0 deletions test/spacex/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
metacall==0.5.0
10 changes: 10 additions & 0 deletions test/spacex/spacex.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
getSpaceXData: async () => {
try {
const response = await axios.get('https://api.spacexdata.com/v3/launchpads')
return response.data
} catch (error) {
return error
}
}
};

0 comments on commit fb79963

Please sign in to comment.