[cs615asa] [git commit] CS615 EBS-BACKUP; backup a directory into Elastic Block Storage (EBS) branch main updated. 6746d7cfc2b5e7730d3ee5148245a2a2b65ba945

Git Owner jschauma at stevens.edu
Sun May 9 14:36:15 EDT 2021


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CS615 EBS-BACKUP; backup a directory into Elastic Block Storage (EBS)".

The branch, main has been updated
       via  6746d7cfc2b5e7730d3ee5148245a2a2b65ba945 (commit)
       via  93e2415b830ab9a96ad40040f028e646d24244da (commit)
       via  ff809bca7ac4fefe2cf066427ef6e5e2bad1de43 (commit)
       via  ded7e02191f2cb593bf2592b500c9eaf3b2a27bb (commit)
       via  a22913bad29fa06e91758ca0a2650e102b4531c2 (commit)
      from  0e0bceae43d7551cb1beb6f726cc2b3e121d0d6b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 6746d7cfc2b5e7730d3ee5148245a2a2b65ba945
Merge: 93e2415 ff809bc
Author: ngoldstein51 <ngoldstein51 at gmail.com>
Date:   Sun May 9 14:38:25 2021 -0400

    Merge commit 'ff809bca7ac4fefe2cf066427ef6e5e2bad1de43' of cs615asa:~jho1/ebs-backup into main


commit 93e2415b830ab9a96ad40040f028e646d24244da
Merge: ded7e02 0e0bcea
Author: ngoldstein51 <ngoldstein51 at gmail.com>
Date:   Sun May 9 12:43:10 2021 -0400

    Merge branch 'main' of cs615asa:~git/ebs-backup into main


commit ff809bca7ac4fefe2cf066427ef6e5e2bad1de43
Author: Justin Ho <jho1 at stevens.edu>
Date:   Sat May 8 22:37:47 2021 -0400

    Added documentation for argument_parsing.py

diff --git a/src/argument_parsing.py b/src/argument_parsing.py
index 38ec315..e482245 100644
--- a/src/argument_parsing.py
+++ b/src/argument_parsing.py
@@ -1,19 +1,21 @@
-'''
-ebs-backup
+"""Parses the arguments passed to ebs-backup.
 
-Usage:
-  ebs-backup [-h] [-l filter] [-r filter] [-v volume-id] <dir>
+This module identifies four command-line options:
+    -h            Print a usage message and exit.
+    -l filter     Pass data through the given filter command on the local
+                  host before copying the data to the remote system.
+    -r filter     Pass data through the given filter command on the remote
+                  host before writing the data to the volume.
+    -v volume-id  Use the given volume instead of creating a new one.
 
-Options:
-  -h            Print a usage message and exit
-  -l filter     Pass data through the given filter command on the local
-                host before copying the data to the remote system.
-  -r filter     Pass data through the given filter command on the remote
-                host before writing the data to the volume.
-  -v volume-id  Use the given volume instead of creating a new one.
-'''
-import argparse
+This module also identifies one mandatory argument:
+    dir           The directory to backup.
+
+Todo:
+    * Remove -i option when done with development
+"""
 
+import argparse
 
 def parse_args(args):
   parser = argparse.ArgumentParser(
@@ -40,7 +42,6 @@ def parse_args(args):
       help='Use the given volume instead of creating a new one.',
   )
 
-  # TODO: remove this when done w/ development
   parser.add_argument(
       '-i',
       metavar='instance-id',

commit ded7e02191f2cb593bf2592b500c9eaf3b2a27bb
Merge: a22913b 721aa15
Author: ngoldstein51 <ngoldstein51 at gmail.com>
Date:   Thu May 6 20:38:11 2021 -0400

    Merge branch 'main' of cs615asa:~git/ebs-backup into main


commit a22913bad29fa06e91758ca0a2650e102b4531c2
Author: ngoldstein51 <ngoldstein51 at gmail.com>
Date:   Wed May 5 12:56:34 2021 -0400

    Added test suites for EC2 and Volume

diff --git a/test/test_arg_parsing.py b/test/test_arg_parsing.py
index 41da750..f9dad3a 100644
--- a/test/test_arg_parsing.py
+++ b/test/test_arg_parsing.py
@@ -8,8 +8,8 @@ from src import parse_args
 
 class ArgParseTest(unittest.TestCase):
     def test_parse_args_success(self):
-        args = parse_args(['-l', 'hello_tests'])
-        expected_args = { 'l': 'hello_tests', 'r': None, 'v': None }
+        args = vars(parse_args(['-l', 'hello_tests', '.']))
+        expected_args = {'l': 'hello_tests', 'r': None, 'v': None, 'dir': '.', 'i': None}
         self.assertEqual(args, expected_args)
 
     def test_parse_failure(self):
diff --git a/test/test_ec2.py b/test/test_ec2.py
new file mode 100644
index 0000000..f2732ee
--- /dev/null
+++ b/test/test_ec2.py
@@ -0,0 +1,15 @@
+import unittest
+import sys
+import os
+from unittest.mock import patch
+from ec2 import EC2
+
+sys.path.append('..')
+
+class EC2Test(unittest.TestCase):
+    def test_example(self):
+        self.assertTrue(True)
+
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/test/test_volume.py b/test/test_volume.py
new file mode 100644
index 0000000..d4bbefc
--- /dev/null
+++ b/test/test_volume.py
@@ -0,0 +1,16 @@
+import unittest
+import sys
+import os
+from unittest.mock import patch
+from volume import Volume
+
+sys.path.append('..')
+
+
+class VolumeTest(unittest.TestCase):
+    def test_example(self):
+        self.assertTrue(True)
+
+
+if __name__ == '__main__':
+    unittest.main()

-----------------------------------------------------------------------

Summary of changes:
 src/argument_parsing.py  | 29 +++++++++++++++--------------
 test/test_arg_parsing.py |  4 ++--
 test/test_ec2.py         | 15 +++++++++++++++
 test/test_volume.py      | 16 ++++++++++++++++
 4 files changed, 48 insertions(+), 16 deletions(-)
 create mode 100644 test/test_ec2.py
 create mode 100644 test/test_volume.py


hooks/post-receive
-- 
CS615 EBS-BACKUP; backup a directory into Elastic Block Storage (EBS)


More information about the cs615asa mailing list