Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: CI

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
python-version: [3.8]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
- name: Run tests
run: |
pytest
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# GitHub Copilot: Your AI-Powered Coding Partner

[![Build Status](https://github.com/MattUebel/copilot-presentation/actions/workflows/ci.yml/badge.svg)](https://github.com/MattUebel/copilot-presentation/actions)

Welcome to the staging area for materials related to the talk, **"GitHub Copilot: Your AI-Powered Coding Partner."** This repository serves as a central hub for content, resources, and links that will help you understand and utilize GitHub Copilot in your coding workflows.

## Overview
Expand Down
25 changes: 25 additions & 0 deletions tests/test_example1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import pytest
from presentation.examples.example1 import add, subtract, multiply, divide

def test_add():
assert add(2, 3) == 5
assert add(-1, 1) == 0
assert add(0, 0) == 0

def test_subtract():
assert subtract(5, 3) == 2
assert subtract(0, 1) == -1
assert subtract(-1, -1) == 0

def test_multiply():
assert multiply(2, 3) == 6
assert multiply(-1, 1) == -1
assert multiply(0, 100) == 0

def test_divide():
assert divide(6, 3) == 2
assert divide(-4, 2) == -2
assert divide(5, 2) == 2.5

with pytest.raises(ValueError):
divide(10, 0)
17 changes: 17 additions & 0 deletions tests/test_example2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import unittest
from presentation.examples.example2 import greet, farewell

class TestExample2(unittest.TestCase):

def test_greet(self):
self.assertEqual(greet("Alice"), "Hello, Alice!")
self.assertEqual(greet("Bob"), "Hello, Bob!")
self.assertEqual(greet(""), "Hello, !")

def test_farewell(self):
self.assertEqual(farewell("Alice"), "Goodbye, Alice!")
self.assertEqual(farewell("Bob"), "Goodbye, Bob!")
self.assertEqual(farewell(""), "Goodbye, !")

if __name__ == '__main__':
unittest.main()