@@ -1435,26 +1435,26 @@ def createFileInZip(self, name, content, ext=".zip", dir=None, zip_name=None):
1435
1435
zip .writestr (name , content )
1436
1436
zip .close ()
1437
1437
return path
1438
-
1438
+
1439
1439
def create_spark_package (self , artifact_name ):
1440
1440
group_id , artifact_id , version = artifact_name .split (":" )
1441
1441
self .createTempFile ("%s-%s.pom" % (artifact_id , version ), ("""
1442
1442
|<?xml version="1.0" encoding="UTF-8"?>
1443
1443
|<project xmlns="http://maven.apache.org/POM/4.0.0"
1444
1444
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1445
- | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
1445
+ | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
1446
1446
| http://maven.apache.org/xsd/maven-4.0.0.xsd">
1447
1447
| <modelVersion>4.0.0</modelVersion>
1448
1448
| <groupId>%s</groupId>
1449
1449
| <artifactId>%s</artifactId>
1450
1450
| <version>%s</version>
1451
1451
|</project>
1452
- """ % (group_id , artifact_id , version )).lstrip (),
1453
- os .path .join (group_id , artifact_id , version ))
1452
+ """ % (group_id , artifact_id , version )).lstrip (),
1453
+ os .path .join (group_id , artifact_id , version ))
1454
1454
self .createFileInZip ("%s.py" % artifact_id , """
1455
1455
|def myfunc(x):
1456
1456
| return x + 1
1457
- """ , ".jar" , os .path .join (group_id , artifact_id , version ),
1457
+ """ , ".jar" , os .path .join (group_id , artifact_id , version ),
1458
1458
"%s-%s" % (artifact_id , version ))
1459
1459
1460
1460
def test_single_script (self ):
@@ -1537,7 +1537,6 @@ def test_package_dependency(self):
1537
1537
self .create_spark_package ("a:mylib:0.1" )
1538
1538
proc = subprocess .Popen ([self .sparkSubmit , "--packages" , "a:mylib:0.1" , "--repositories" ,
1539
1539
"file:" + self .programDir , script ], stdout = subprocess .PIPE )
1540
-
1541
1540
out , err = proc .communicate ()
1542
1541
self .assertEqual (0 , proc .returncode )
1543
1542
self .assertIn ("[2, 3, 4]" , out )
@@ -1553,7 +1552,7 @@ def test_package_dependency_on_cluster(self):
1553
1552
""" )
1554
1553
self .create_spark_package ("a:mylib:0.1" )
1555
1554
proc = subprocess .Popen ([self .sparkSubmit , "--packages" , "a:mylib:0.1" , "--repositories" ,
1556
- "file:" + self .programDir , "--master" ,
1555
+ "file:" + self .programDir , "--master" ,
1557
1556
"local-cluster[1,1,512]" , script ], stdout = subprocess .PIPE )
1558
1557
out , err = proc .communicate ()
1559
1558
self .assertEqual (0 , proc .returncode )
0 commit comments